Jump to content

sweinkauf13

Members
  • Posts

    106
  • Joined

  • Last visited

Everything posted by sweinkauf13

  1. Hello,Ok so this loop is the loop that will execute forever. The loop itself is self explanitory on what it should do. I just cant catch what is making it not break ever. If anyone can help me out that would be great. The loop code is posted below. while($_SESSION[ohealth] > "0" && $_SESSION[health] > "0" && $_SESSION[ohealth] != "0" && $_SESSION[health] != "0"){ if($_SESSION[turn] == "0") {#######User Turn########$num = math.rand(1,20);$a = $_SESSION[att_t] * $num;$attack = $a - $_SESSION[odef_t];$health = "$_SESSION[ohealth]";$h = $health - $attack;$_SESSION[ohealth] = "$h";$_SESSION[turn] = "1"; } else if($_SESSION[turn] == "1") {$num = math.rand(1,20);$a = $_SESSION[oatt_t] * $num;$attack = $a - $_SESSION[def_t];$health = "$_SESSION[health]";$h = $health - $attack;$_SESSION[health] = "$h";$_SESSION[turn] = "0"; }#} Also I would like to add that all the SESSION varibles are full and none are left NULL. Thank you in advance,Youngwebmaster
  2. Thank you and yes it was I was supose to be using the ftp functions and not the regular functions for file control. It works now. Thank you,Youngwebmaster
  3. Hello,I am writting a script to create a new directory. Very simple but I cant figure out why it isnt working. Here is the script: <?#$ndir = "$_POST[ndir]";#if($ndir != ""){mkdir("$ndir");}?> Thanks in advance,YoungwebmasterOh, also I am trying to do the same thing with creating a new file and this script goes like this: <?#$nfile = "$_POST[nfile]";#if($nfile != ""){$handle = fopen("$nfile","a");}?>
  4. Ok i've implemented the things you all have said. It works now. Thanks for everything.-Youngwebmaster
  5. Dang it. Umm one last problem I ran into if you dont mind. I get a new error now "mysql_num_rows(): supplied argument is not a valid MySQL result resource in inbox.php on line 27";. How do I fix that? I've never seen it before.
  6. o. haha now i see it. thanks. i feel kinda embarrest and blind. but thanks.i appreciate it.
  7. Hello,I'm writting a basic script to get some information out of a database table. The script name is inbox.php. Here is the error im getting: (directory modified for security): "Parse error: parse error in inbox.php on line 57". But i was looking and i cant find the error. Please help. <?session_start();?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Entertainment Zone!!!</title><link rel="stylesheet" type="text/css" href="style.css"></head><body><p><h1>EZ Messenger System</h1></p><p><h2><? echo("$_SESSION[username]"); ?>'s Inbox:</h2></p><center><p><?$con = @mysql_connect('server','username','password') or die(mysql_error());#$db = @mysql_select_db('entertainmentzone', $con) or die(mysql_error());#$username = "$_SESSION[username]";$sql = "select * from messages where to = '$username'";#$result = mysql_query("$sql", $con);#$num = mysql_num_rows($result);#if($num == "0"){echo("Inbox Empty");}else if($num > "0"){$inbox = "<table cellspacing=5 cellpadding=5 rules=all><tr><th>From</th><th>Subject</th><th>Date</th></tr>";# while($row = mysql_fetch_array($result)) {$from = $row['from'];$subject = $row['subject'];$date = $row['date'];$status = $row['status'];# if($status == "unread") {$setting = "background-color=\"#151B54\""; }else if($status == "read") {$setting = "background-color=\"#2B3856\"; } else {$setting = ""; }#$inbox .="<tr $setting><td>$from</td><td>$subject</td><td>$date</td></tr>"; }$inbox .= "</table></p>";echo("$inbox");}?></body></html> -youngwebmaster
  8. Ok I have now downloaded fiddler. I ran the script and it came up in the fiddler program. It was in red. But im not sure how to use the fiddler program to help me with my error.
  9. ok disregard that last post. Ok here are the errors the IE debugger gave me:Converting backslash in URI to slashEscaping malformed URI reference
  10. Ok, so first off i'd like to say im srry for not being a big part of the board during the last few months. With school and sports I did not do very much free time things on the computer. ok sooo anyway. Here is what i'm workin on...I'M makin a little project to play music. It's not a very complicated idea. But here is my problem. when play_media.php gets the song path it doesnt play anything (the player(when play is clicked) plays nothing). altho i've tested the paths and they lead to the song files. A side note for that, its only when the play_media.php script gets a full path (when it gets a complete path to the songs on my hard drive.) and not when it goes and gets it from the database. here are the files:[select_song_step1.php] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>LiveMP3!</title><link rel="stylesheet" type="text/css" href="style.css"></head><body> <div class="ipod"><hr color="white"> <div class="song_list"><p>Song List:</p><?$connection = @mysql_connect("localhost",'user','pass') or die(mysql_error());#$database = "livemp3";$tablename = "music";#$db = @mysql_select_db($database, $connection) or die(mysql_error());$sql = "select * from $tablename";$result = @mysql_query($sql, $connection) or die(mysql_error());#$table = "<p><table cellspacing=5 cellpadding=5 class=\"arcade\">";#while ($row = mysql_fetch_array($result)){$id = $row['id'];$dm = $row['display_name'];#$table .= "<tr><td><a href=\"play_media.php?song=$id\">$dm</a></th></tr>";}$table .= "</table></p>";#echo "$table";#?><hr color="white"><p>Or to get a song from your computer type in it's location below and it will play:</p> <form method="post" action="play_media.php"><p><input type="text" name="song_url" size="25"></p><p align="right"><input type="submit" value="Play"></p> </form><hr color="white"> </div> </div> <div class="info_box"><h3><p>Menu:</p></h3><p><a href="index.php">Go to Homepage</a></p><p><a href="main.php">Go back to media selection page</a></p> </div></body></html> [play_media.php] <?$song = "$_GET[song]";if($song != ""){$connection = @mysql_connect("localhost",'user','pass') or die(mysql_error());#$database = "livemp3";$tablename = "music";#$db = @mysql_select_db($database, $connection) or die(mysql_error());$sql = "select * from $tablename where id = $song";$result = @mysql_query($sql, $connection) or die(mysql_error());##$row = mysql_fetch_array($result);$fn = $row['file_name'];# add full string to $fn$file_name = "music/$fn";$file_size = $row['file_size'];$dn = $row['display_name'];$artist = $row['artist'];$length = $row['length'];}?><?$song = "$_GET[song]";if($song == ""){#$na = "Unknown";#require("defults.inc");$fn = "$_POST[song_url]";$fn = stripslashes("$fn");$file_name = "$music_domain\\$fn";$file_size = "$na";$dn = "$na";$artist = "$na";$length = "$na";}?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>LiveMP3!</title><link rel="stylesheet" type="text/css" href="style.css"></head><body> <div class="ipod"><hr color="white"> <!-- Start Player --><embed id="player" Controls="smallconsole"height="280" width="195" src="<? echo("$file_name"); ?>" autostart="false"></p> </div> <div class="info_box"><h2><p>Song Information:</p></h2><p><b><? echo("$dn"); ?> by <? echo("$artist"); ?></b></p><p>Song Size: <? echo("$file_size"); ?></p><p>Song Length: <? echo("$length"); ?></p><p><a href="main.php">Back</a></p> </div></body></html> Ok. some things i'm quickly going to go over:in play_media.php: require("defults.inc");$fn = "$_POST[song_url]";$fn = stripslashes("$fn");$file_name = "$music_domain\\$fn"; about:here I have taken the defult path to the folder on my hard drive called My Music (basic windows folder) to avoid having to type it in. the url is turning out fine from this. The url to the songs are complete.One last thing i will post is my play_media.php after a submission: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>LiveMP3!</title><link rel="stylesheet" type="text/css" href="style.css"></head><body> <div class="ipod"><hr color="white"> <!-- Start Player --><p><embed id="player" Controls="smallconsole"height="280" width="195" src="C:\Documents and Settings\Profile Name\My Documents\My Music\artist\music_file.wma" autostart="false"></p> </div> <div class="info_box"><h2><p>Song Information:</p></h2><p><b>Unknown by Unknown</b></p><p>Song Size: Unknown</p><p>Song Length: Unknown</p><p><a href="main.php">Back</a></p> </div></body></html> again real quickly here is one thing i'd like to point out: <div class="ipod"><hr color="white"> <!-- Start Player --><p><embed id="player" Controls="smallconsole"height="280" width="195" src="C:\Documents and Settings\Profile Name\My Documents\My Music\artist\music_file.wma" autostart="false"></p> </div> here I've changed the url a bit as not to give a way information. So some place holders were used in this example.Ok. so here is everything related to this issue as far as I know. If more information / scripts are required please let me know. Thanks in advance,Youngwebmaster
  11. Ok. I added doctype and took out language=javascript. But i still get the same result. Anything else i can do?
  12. Hello,I have a page that has 2 "team selections" on it. just 2 radio sets. Now when it is submitted it is supose to validate() and see if team1 is equal to team2. if it is, it is supose to stop the submission and alert(). And if team1 is not eqaul to team2 then it should carry on as directed. But right now it does not seem to validate(). Even when i set both team1 and team2 to the same value it does not stop the submission and it submits to the start.php script. I'm not sure why it is not stopping me. Please help me!here is the code: <html><head><title>Hockey</title><style>img.teamlogo{height: 100pt;width: 100pt;}</style><script LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">function validate(){team1 = document.form.team1.value;team2 = document.form.team2.value;if(team1 == team2){alert("Sorry, you have set both teams to the same thing\n Please select two DIFFERENT teams");}}</script></head><body><p>Player 1 please pick your team:</p><form method="post" action="start.php" onsubmit="validate()"><p><table cellspacing="10" cellpadding="5" rules=cols><tr><td><img src="admirals.png" class="teamlogo"></td><td><img src="energy.jpg" class="teamlogo"></td><td><img src="avalanche.gif" class="teamlogo"></td><td><img src="mapleleafs.gif"class="teamlogo"></td><td><img src="predators.gif" class="teamlogo"></td></tr><tr align="center"><td><input type="radio" name="team1" value="admirals.png"></td><td><input type="radio" name="team1" value="energy.jpg"></td><td><input type="radio" name="team1" value="avalanche.gif"></td><td><input type="radio" name="team1" value="mapleleafs.gif"></td><td><input type="radio" name="team1" value="predators.gif"></td></tr></table></p><p>Player 2 please pick your team:</p><p><table cellspacing="10" cellpadding="5" rules=cols><tr><td><img src="admirals.png" class="teamlogo"></td><td><img src="energy.jpg" class="teamlogo"></td><td><img src="avalanche.gif" class="teamlogo"></td><td><img src="mapleleafs.gif"class="teamlogo"></td><td><img src="predators.gif" class="teamlogo"></td></tr><tr align="center"><td><input type="radio" name="team2" value="admirals.png"></td><td><input type="radio" name="team2" value="energy.jpg"></td><td><input type="radio" name="team2" value="avalanche.gif"></td><td><input type="radio" name="team2" value="mapleleafs.gif"></td><td><input type="radio" name="team2" value="predators.gif"></td></tr></table></p><p align="right"><input type="submit" value="START"></p></form></body></html> Thanks in advance,youngwebmaster
  13. Thank you Wander and jlhaslip for helping me. My script works now.But now i have a different problem. I have a script somewhat like this. It enters info into a mysql database and it is supose to auto-increment the column titled "id". But it doesn't increment. It just sets every entry id to 0? The script is posted below. Please help me yet again. <?session_start();if(($_SESSION[username] == "") ||($_SESSION[password] == "")){header("location: login.phtml");exit;}?><?################Add date################$connection = @mysql_connect('localhost','user','pass') or die(mysql_error());$database = "familyconnection";$db = @mysql_select_db("$database", $connection) or die(mysql_error());#for($i=0; $i< $_POST[fieldcount]; $i++){$sql = "insert into calandar(id, date, discription) values (\"\",'{$_POST[month][$i]} {$_POST[day][$i]} {$_POST[year][$i]}','{$_POST[discription][$i]}');"; #$result = @mysql_query("$sql", $connection) or die(mysql_error());}#?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Family Connection</title><link rel=stylesheet type="text/css" href="style.css"></head><body><div class="login_outline"><br><br><p><center><img src="header_image.gif" alt="Header Image" width="625"></center></p> <div class="login_body"><p>Welcome, <? echo "$_SESSION[real_name]"; ?> [<a href="logout.php">Log Out</a>]</p> <div class="menu"><div class="button_1"><a href="home.phtml" class="button"><p>Home<p></a></div><div class="button_2"><center><a href="add_date_step_one.php" class="button"><p>Add A Date To The Calandar</p></a></center></div><div class="button_3"><center><a href="fms/index.php" class="button"><p>Family Mail Service</p></a></center></div><div class="button_4"><center><p><a href="feedback.phtml" class="button">Feedback</a></p></center></div><div class="button_5"><center><p><a href="quick_links.phtml" class="button">Quick Links</a></p></center></div><div class="button_6"><center><p><a href="arcade.phtml" class="button">Arcade</a></p></center></div><?If($_SESSION[username] == "admin"){$button = "<div class=\"button_7\"><center><p><a href=\"admin_mode/admin_index.phtml\" class=\"button\">Admin Mode</a></p></center></div>";#echo("$button");}else{$button = "<div class=\"button_7\"><center><p><a href=\"picks.phtml\" class=\"button\">Top Picks</a></p></center></div>";echo "$button";}?><br><br><br><p><hr size="2" color="black" class="divide_line"></p><p>Your date(s) were added. Please choose an option above.</p> Thanks in advace,youngwebmaster
  14. OK. all this script is suppose to do is add the user input into a mysql table. but i get this error:" Parse error: parse error in arcade_add.php on line 22". First is line 22 and then there is the rest of my script incase i counted wrong. $db = @mysql_select_db("$my_db", $connection) or die(mysql_error()); <?session_start();if(($_SESSION[username] == "") ||($_SESSION[password] == "")){header("location: login.phtml");exit;}?><?$id = "$_POST[id]";$g_name = "$_POST[gamename]";$g_dis = "$_POST[discription]";$g_code = "$_POST[gamecode]";$g_width = "$_POST[width]";$g_height = "$_POST[height]";#$my_db = "arcade";$connection = @mysql_connect("localhost","user","pass") or die(mysql_error());$db = @mysql_select_db("$my_db", $connection) or die(mysql_error());$sql = "insert into games (game_id, gamename, gamediscription, gamelink, gamecode, width,height) values (\"$id\",\"$g_name\",\"$g_dis\","<form method=\"post\" action=\"playgame.phtml\"><input type=\"hidden\" name=\"game\" value=\"$id\"><input type=\"submit\" value=\"Play Game\" class=\"playgame\"></form>\",\"$g_code\",\"$g_width\",\"$g_height\")";$result = @mysql_query("$sql", $connection) or die(mysql_error());?><?session_start();if(($_SESSION[username] == "") ||($_SESSION[password] == "")){header("location: login.phtml");exit;}?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Family Connection</title><link rel=stylesheet type="text/css" href="style.css"><link rel=icon type="image/x-icon" href="fav_icon.ico"></head><body><p class="adminmenu"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="138" height="204"><PARAM name="movie" value="flashvortex.swf"><PARAM name="quality" value="best"><PARAM name="menu" value="true"><PARAM name="allowScriptAccess" value="always"><EMBED src="flashvortex.swf" quality="best" menu="true" width="138" height="204" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"></EMBED></OBJECT></p><div class="home_outline"><br><br><p><center><img src="header_image.gif" alt="Header Image" width="625"></center></p> <div class="login_body"><p>Welcome, <? echo "$_SESSION[real_name]"; ?> [<a href="http://localhost/familyconnection.com/logout.php">Log Out</a>]</p> <div class="menu"><div class="button_1"><a href="http://localhost/familyconnection.com/home.phtml" class="button"><p>Home<p></a></div><div class="button_2"><center><a href="http://localhost/familyconnection.com/add_date_step_one.php" class="button"><p>Add A Date To The Calandar</p></a></center></div><div class="button_3"><center><a href="http://localhost/familyconnection.com/fms/index.php" class="button"><p>Family Mail Service</p></a></center></div><div class="button_4"><center><p><a href="http://localhost/familyconnection.com/feedback.phtml" class="button">Feedback</a></p></center></div><div class="button_5"><center><p><a href="http://localhost/familyconnection.com/quick_links.phtml" class="button">Quick Links</a></p></center></div><div class="button_6"><center><p><a href="http://localhost/familyconnection.com/arcade.phtml" class="button">Arcade</a></p></center></div><?If($_SESSION[username] == "admin"){$button = "<div class=\"button_7\"><center><p><a href=\"http://localhost/familyconnection.com/admin_mode/admin_index.phtml\" class=\"button\">Admin Mode</a></p></center></div>";#echo("$button");}else{$button = "<div class=\"button_7\"><center><p><a href=\"http://localhost/familyconnection.com/picks.phtml\" class=\"button\">Top Picks</a></p></center></div>";echo("$button");}?><br><br><br><p><hr size="2" color="black" class="divide_line"></p><br><p>Game was entered!!!</p><p> please help me!!!-youngwebmaster
  15. thank you. It is now working. I thank everyone who helped me solve this problem.So that people can see how this was resolved i'm posting my code below. I hope this can help someone else as well. <?$g =(int)$_POST['game'];$connection = @mysql_connect('localhost','username','password') or die(mysql_error());$database = "arcade";$tb = "games";#$db = @mysql_select_db("$database",$connection) or die(mysql_error());$sql = "select * from $tb where game_id = $g";$result = @mysql_query("$sql",$connection) or die(mysql_error());#$row = @mysql_fetch_array($result) or die(mysql_error());$game = $row['gamecode'];echo "$game";?> Thanks again,youngwebmaster
  16. ok, so i edited the script for what you said. Here's what i've got. <p><?$g =(int)$_POST['game'];$connection = @mysql_connect('localhost','username','password') or die(mysql_error());$database = "arcade";$tb = "games";#$db = @mysql_select_db("$database","$connection") or die(mysql_error());$sql = "select * from $tb where game_id = $g;";$result = @mysql_query("$sql","$connection") or die(mysql_error());#$row = @mysql_fetch_array($result) or die(mysql_error());$game = $row['gamecode'];echo "$game";?></p> but i still get the same result. Nothing. Is there anything else? I'm sure i'm overlooking something but i'm not sure what.thanks,youngwebmaster
  17. Ok. Maybe people aren't responding because of the size of the document i showed. Here is just the part of the document that i am having problems with: <p><?$g ="$_POST[game]";$connection = @mysql_connect('localhost','username','password') or die(mysql_error());$database = "arcade";$tb = "games";#$db = @mysql_select_db("$database","$connection") or die(mysql_error());$sql = "select * from $tb where game_id==$g;";$result = @mysql_query("$sql","$connection") or die(mysql_error());#$row = @mysql_fetch_array($result) or die(mysql_error());$game = $row['gamecode'];echo "$game";?></p> I hope this helpes. I really need help on this as soon as possible because i was hoping to give this project as a gift to my family on christmas. 2 days away.thank you,youngwebmaster
  18. Ok. So i'm pretty new to javascript and i'm sure this is a silly mistake that i've made. I'm trying to make a rollover button. Here is my script for the rollover and then my button. in that order.Script: <script type="text/javascript">function mouseOver(){document.submit.src ="next_2.png";}function mouseOut(){document.submit.src ="next_1.png";}</script> Button: <input type="image" name="submit" src="next_1.png" class="b_next" id="submit" onmouseOver="mouseOver()"onmouseOut="mouseOut()"> So with this code, i go over the button with my mouse, it stays the same and then in the bottom left of my browser "Error on page" is shown. Please help me.thanks in advance,youngwebmaster
  19. Ok, so i'm working on a project which has an "arcade". Now it uses a mysql database called "arcade" and a table called "games" that holds all the information on the games. Now each game link points to one document "playgame.phtml". shown below: <?session_start();if(($_SESSION[username] == "") ||($_SESSION[password] == "")){header("location: login.phtml");exit;}?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Family Connection</title><link rel=stylesheet type="text/css" href="style.css"></head><body><div class="login_outline"><br><br><p><center><img src="header_image.gif" alt="Header Image" width="625"></center></p> <div class="login_body"><p>Welcome, <? echo "$_SESSION[real_name]"; ?> [<a href="logout.php">Log Out</a>]</p> <div class="menu"><div class="button_1"><a href="home.phtml" class="button"><p>Home<p></a></div><div class="button_2"><center><a href="add_date_step_one.php" class="button"><p>Add A Date To The Calandar</p></a></center></div><div class="button_3"><center><a href="fms/index.php" class="button"><p>Family Mail Service</p></a></center></div><div class="button_4"><center><p><a href="feedback.html" class="button">Feedback</a></p></center></div><div class="button_5"><center><p><a href="quick_links.phtml" class="button">Quick Links</a></p></center></div><div class="button_6"><center><p><a href="arcade.phtml" class="button">Arcade</a></p></center></div><?If($_SESSION[username] == "admin"){$button = "<div class=\"button_7\"><center><p><a href=\"admin_mode/admin_index.phtml\" class=\"button\">Admin Mode</a></p></center></div>";#echo("$button");}else{$button = "<div class=\"button_7\"><center><p><a href=\"picks.phtml\" class=\"button\">Top Picks</a></p></center></div>";echo("$button");}?><br><br><br><p><hr size="2" color="black" class="divide_line"></p><p><?$g ="$_POST[game]";$connection = @mysql_connect('localhost','username','password') or die(mysql_error());$database = "arcade";$tb = "games";#$db = @mysql_select_db("$database","$connection") or die(mysql_error());$sql = "select * from $tb where game_id==$g;";$result = @mysql_query("$sql","$connection") or die(mysql_error());#$row = @mysql_fetch_array($result) or die(mysql_error());$game = $row['gamecode'];echo "$game";?></p> </div></div></body></html> Now this document recieves the "id" of the game the user wants from the button on the previous page.($_POST[game]). So this script is supose to go and match the id number that it got to the corisponing one in the mysql table and then get the information out of the "gamecode" column. Which has something like this in it: <embed src="http://www.addictinggames.com/D78AQSAKQLQWI9/5173.swf" type="application/x-shockwave-flash" width="720" height="600"></embed><br><a href="http://www.addictinggames.com" target="_blank" title="Play Games">Play Games at AddictingGames</a> Then echo this code out to the page which should produce the game that the user wanted. Now when i used the code first shown, it parsed and showed a page. but no game! i checked the source for the page it was showing and it was blank after the black line (<hr>). So it's like the code didn't parse. So then i went and changed the code to make an error, and then refreshed the page and it showed an error message, so i know the script is being parsed. But then why am i seeing no game? Please help me. Did i do something wrong? I'm relitivly new to useing php and mysql together like this. If there is anything more you need from me, please let me know.thank you in advance,youngwebmaster
  20. Alright. It's all fixed. Thank you to everyone who has taken thier time to help me solve my problem. I really appreciate it.-youngwebmaster
  21. thank you justsomeguy. I understand this now and thanks to all who have helped me this far. I'll try what you said and post back.thanks,youngwebmaster
  22. ok. I did what you said and got this. The following is the source code for the page it generated so you can see what is happening: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Wish List Generator</title><link rel=stylesheet type="text/css" href="style.css"></head><body><H1><p><center></p></H1><table cellspacing=5 cellpadding=5><tr><th>Item Name</th><th>Item Price</th><th>Item Location</th><th>Rating</th></tr><tr><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td></tr><tr><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td></tr><tr><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td><td>function array_debug() { echo '<pre>'; ksort(); print_r(); echo '</pre>'; } //This defines the function.array_debug(Array); // This calls the function.</td></tr></BODY></HTML> Now here is my source code for your_list.php after i inserted the recomended block. <?#########################Create WishList Print-Out##########################Build begginging of table$wish_list = "<table cellspacing=5 cellpadding=5><tr><th>Item Name</th><th>Item Price</th><th>Item Location</th><th>Rating</th></tr>";for ($i = 0; $i < count($_POST[item_name]); $i++) {#add the data to the wishlist one row at a time$wish_list .= "<tr><td>function array_debug($array_name) { echo '<pre>'; ksort($array_name); print_r($array_name); echo '</pre>'; } //This defines the function.array_debug($_POST[item_name]); // This calls the function.</td><td>function array_debug($array_name) { echo '<pre>'; ksort($array_name); print_r($array_name); echo '</pre>'; } //This defines the function.array_debug($_POST[item_price]); // This calls the function.</td><td>function array_debug($array_name) { echo '<pre>'; ksort($array_name); print_r($array_name); echo '</pre>'; } //This defines the function.array_debug($_POST[item_location]); // This calls the function.</td><td>function array_debug($array_name) { echo '<pre>'; ksort($array_name); print_r($array_name); echo '</pre>'; } //This defines the function.array_debug($_POST[item_rating]); // This calls the function.</td></tr>";}##write this out to the screen?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Wish List Generator</title><link rel=stylesheet type="text/css" href="style.css"></head><body><H1><p><center><? echo "$_POST[wish_list_name]"; ?></p></H1><? echo "$wish_list"; ?></BODY></HTML> I wish i could debug this myself but your getting into stuff i'm not very familar with. Sorry i can't be more help. So if there is anything i can do, please let me know.Thanks again,youngwebmaster
  23. Yes i did. Here is how your_list.php looks now after i inserted your code block. But one thing. I After your code block didn't work, i tried taking the <pre> stuff out. So this script is puposfully missing that. I don't know if that's wrong or right.your_list.php <?#########################Create WishList Print-Out##########################Build begginging of table$wish_list = "<table cellspacing=5 cellpadding=5><tr><th>Item Name</th><th>Item Price</th><th>Item Location</th><th>Rating</th></tr>";for ($i = 0; $i < count($_POST[item_name]); $i++) {#add the data to the wishlist one row at a time$wish_list .= "<tr><td>// array_debug - print out a formatted list of an arrayfunction array_debug($_POST[$item_name]) { ksort($_POST[item_name]); print_r($_POST[item_name]); } // end func</td><td>// array_debug - print out a formatted list of an arrayfunction array_debug($_POST[item_price]) { ksort($_POST[item_price]); print_r($_POST[item_price]); </td><td>// array_debug - print out a formatted list of an arrayfunction array_debug($_POST[item_location]) { ksort($_POST[item_location]); print_r($_POST[item_location]); </td><td>// array_debug - print out a formatted list of an arrayfunction array_debug($_POST[item_rating]) { ksort($_POST[item_rating]); print_r($_POST[item_rating]); } // end func</td></tr>";}##write this out to the screen?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Wish List Generator</title><link rel=stylesheet type="text/css" href="style.css"></head><body><H1><p><center><? echo "$_POST[wish_list_name]"; ?></p></H1><? echo "$wish_list"; ?></BODY></HTML> And if this is helpful...entree_interface.php (Note: this script currently works to my knowlage) <?#########################Create Entree Interface##########################write out top of entree table$form_block = "<form method=\"post\" action=\"your_wishlist.php\"><input type=\"hidden\" value=\"$_POST[wish_list_name]\"><table cellspacing=5 cellpadding=5><tr><th>Item Name</th><th>Item Price</th><th>Item Location</th><th>Rating</th></tr>";#count from 0 until you reach specified number of entree itemsfor($i = 0; $i <$_POST[item_num]; $i++){#add one entree row$form_block .= "<tr><td align=\"center\"><input type=\"text\" name=\"item_name[]\" size=\"25\"></td><td align=\"center\"><input type=\"text\" name=\"item_price[]\" size=\"15\"></td><td align=\"center\"><input type=\"text\" name=\"item_location[]\" size=\"25\"></td><td align=\"center\"> <select name=\"item_rating[]\"><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"9\">9</option><option value=\"10\">10</option> </select></td></tr>";}##now write in the end of the form block#$form_block .= "<TR><TD ALIGN=CENTER COLSPAN=4><INPUT TYPE=\"submit\" VALUE=\"Create Wishlist\"></TD></TR></TABLE></form>";#now write it out to the page?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>Wish List Generator</title><link rel=stylesheet type="text/css" href="style.css"></head><body><H1><p>Add Items To <? echo "$_POST[wish_list_name]"; ?></p></H1><? echo "$form_block"; ?></BODY></HTML> Did i put it in the right place? What do i need to do differently to make this work?
×
×
  • Create New...