
15-03-2006, 15:39
|
|
|
|
חבר מתאריך: 08.08.03
הודעות: 29
|
|
|
בעיה עם mysql_query
שלום
כתבתי קוד של guestbook
ומשום מה חוזרת לי שגיאה בקטע של ה mysql_query
Notice: Undefined variable: name in c:\program files\easyphp1-8\www\test\sign.php on line 31
Notice: Undefined variable: location in c:\program files\easyphp1-8\www\test\sign.php on line 31
Notice: Undefined variable: email in c:\program files\easyphp1-8\www\test\sign.php on line 31
Notice: Undefined variable: url in c:\program files\easyphp1-8\www\test\sign.php on line 31
Notice: Undefined variable: comments in c:\program files\easyphp1-8\www\test\sign.php on line 31
והקוד של התוכנית הוא:
קוד PHP:
<h2>Sign my guest book!!!</h2>
<form method=post action="create_entry.php">
<b>Name:</b> <input type=text size=40 name=name> <br> <b>Location</b> <input type=text size=40 name=location> <br> <b>Email:</b> <input type=text size=40 name=email> <br> <b>Home Page URL:</b> <input type=text size 40 name=url> <br> <b>Commecnts:</b> <textarea name=comments cols=40 rows=4 wrap=virtual></textarea> <br>
<input type=submit name=submit value="Sign!"> <input type=reset name=reset value="Start Over">
</form> <?php include("dbconnect.php");
if ($submit = "Sign!") { $query = "insert into guestbook (name,location,email,url,comments) values('$name','$location','$email','$url','$comme nts')"; mysql_query($query) or die(mysql_error()); ?> <h2>Thanks!!</h2> <h2><a href="view.php">View my guest book!</a></h2> <?php } else { include("sign.php"); } ?>
ממה נובעת הבעיה? תודה
|