RE: Re[2]: [PHP] [Q]PHP not taking input values from forms
| From: | Dan Aloma | Date: | Wed, 11 Feb 2004 18:32:16 +0000 |
| Subject: | RE: Re[2]: [PHP] [Q]PHP not taking input values from forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177440@lists.php.net to get a copy of this message | ||
I tried adding that code you gave me, but all it does go back to the same page, and doesn't echo out the time(); results. I can't seem to figure it out for the life of me. like i said, everything else in php is working fine, except for this.
From: Richard Davey <rich@launchcode.co.uk> Reply-To: Richard Davey <rich@launchcode.co.uk> To: "Dan Aloma" <digistuff1@hotmail.com> CC: php-general@lists.php.net Subject: Re[2]: [PHP] [Q]PHP not taking input values from forms Date: Wed, 11 Feb 2004 18:20:11 +0000 Hello Dan, Wednesday, February 11, 2004, 6:01:21 PM, you wrote: DA> Sorry about not including code the first time. Here is a snippet of code I DA> am fairly certain should be doing something. Thank you SOOO much for the Your code is (mostly) fine. The only part that didn't work is the final "the form has been submitted" section because it comes after the HTML page end. Move it to the start. Also, you don't have a closing form tag. The following is your code, changed slightly.. try it and see but it works perfectly here (PHP 4.3.2, Apache, Windows). I added the echo time() line so you can see if the page reloads or not: <html> <body> <?php if ($_POST['submit']) {_________________________________________________________________ Click here for a FREE online computer virus scan from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963echo "The form has been submitted<br>"; echo time();} ?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <table width="500" border="0" cellpadding="5" cellspacing="0"> <tr> <td>Your name:</td> <td><input type="text" name="name"value="<?=$_POST['name']?>"></td> </tr> <tr> <td>Your email:</td> <td><input type="text" name="email" value="<?=$_POST['email']?>"><td> <tr> <tr> <td>Your message:</td> <td><textarea name="message"><?=$_POST['message']?></textarea></td></tr> </table> <input type="hidden" name="required" value="name,email,message"> <input type=submit name="submit" value="submit"> </form> </body> </html> -- Best regards,Richard mailto:rich@launchcode.co.uk-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php