undefined variable

From: Date: Thu, 28 Aug 2003 16:38:15 +0000
Subject: undefined variable
Groups: php.general 
Request: Send a blank email to php-general+get-161104@lists.php.net to get a copy of this message
Can anyone tell me what's wrong with my code? I tried to create a form in html and redirect it to php. but result said: Notice: Undefined variable: sender_name in c:\program files\apache group\apache\htdocs\do_feedback.php on line 2 and for all the variables ("sender_email", "like_site", and "text area"). I have been tring to use variable but it is always said "Undefined variable". Please help, Thanks. This is the code for form <FORM method="POST" action="do_feedback.php"> <p>your name: <INPUT type="text" NAME="sender_name" size=30></p> <p>your email: <INPUT type="text" NAME="sender_email" size=30></p> <p> Did you like the site? <INPUT type="radio" NAME="like_site" value="Yes" checked> yes <INPUT type="radio" NAME="like_site" value="No"> no </p> <p>Additional message:<br> <textarea name="message" cols=30 rows=5></textarea> </p> <INPUT type="submit" value="Send"> </FORM> Code for php: <? $_POST["msg"] = "Sender's Full Name:\t$sender_name\n"; $_POST["msg"] .="Sender's E-mail:\t$sender_email\n"; $_POST["msg"] .="Did you like the site?\t$like_site\n"; $_POST["msg"] .="Additional Message:\t$message\n\n"; $_POST["mailheaders"] = "From: yoyo.monash.edu.my\~nthonyak\M\n"; $_POST["mailheaders"] .="Reply-To: $sender_email\n\n"; mail("merry_e_k@hotmail.com", "Feedback Form", $msg, $mailheaders); echo $_POST["sender_name"]; echo "<P align=center>We appreciate your feedback</P>"; ?>

« previous php.general (#161104) next »