Re: passing variables values using POST
| From: | Jason Pruim | Date: | Tue, 18 Mar 2008 12:05:55 +0000 |
| Subject: | Re: passing variables values using POST | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271708@lists.php.net to get a copy of this message | ||
On Mar 18, 2008, at 6:43 AM, Sudhakar wrote:
i am presently passing the value of a variable to a php file using GET after data has been inserted to the database. ex= $firstname = $_POST["firstname"]; if(!$sqlconnection) { echo "error message"; } else { header("Location: thankyou.php?firstnameis=$firstname"); } how can i send the value of $firstname using POST instead of GET as the value is presently appearing in the address bar. ideally i would like using POST. NOTE = please suggest techniques that does NOT involve javascript in order to pass $firstname using POST method, as i have done the entire validations using php and i have assumed that user has javascript turned off.by the looks of it... You already have it setup right... basically you would you something like this: FORM: <form method="post" action="mysuperphppage.php"> <input type="text" name="txtfirstname"> <input type="submit"> </form> mysuperphppage.php: <?PHP $firstname = $_POST['txtfirstname']; echo <<<HTML Thank you {$firstname}, You're the best! HTML; ?> Of course, all untested, but it should get you the basics... -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com japruim@raoset.com