Q About Php And Forms

liunx

Guest
Hi, I am pretty clueless about PHP and scripting, and now I have a client who wants a form done by tomorrow. I'm using aformmail 1.1, and I got it to work, so that's fine. After the user clicks "submit", aformmail sends them to a redirect (thank-you type) page.<br /><br />What I need (long story, don't ask) is for the redirect page to reprint everything the user typed into the form, so they can print it. Is this possible? I imagine it is. Would the code live in the redirect page itself, or in the PHP script?<br /><br />If anyone can instruct me on this, or send me to a web site with instructions, I'd greatly appreciate it. I've been hunting around, but since I don't even know the technical name of what I'm trying to do here, I haven't found anything yet.<br /><br />TIA,<br />Jennifer<!--content-->
Hi Jennifer.<br /><br />It really depends on how you have it working but from your description, I'd say the code should live in the PHP script.<br /><br />Here's what you need to know:<br /><br />PHP stores the values of submitted form elements in a global variable called $_POST.<br />$_POST is actually an array, meaning it's kind of a variable container.<br />Skipping the technical details, each submitted form field can be accessed in the PHP script that receives the form posting by using $_POST['field_name'].<br /><br />So, for instance, if you have two fields in your form named "name" and "email", after submitting the form, you can access that value in the PHP script by using $_POST['name'] and $_POST['email'].<br /><br />So, for instance, if you wanted to print a confirmation to the user, you could do something like this (some HTML tags are lacking, I know, I ommited them for simplicity's sake) :<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><html><br /><body><br />Hello <?php print $_POST['name']; ?>. The e-mail you submitted was <?php print $_POST['email']; ?> - is that correct?<br /></body><br /></html><!--c2--></div><!--ec2--><br /><br />Give it a try and let me know if it helps. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Raul, once again you are the MAN!!!<!--content-->
Thanks, Steve. Just trying to help where I can, sharing the knowledge <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Thanks! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Your info put me on the right track, and I found some more PHP tutorials, once I knew what to look for...I have been up to my ears in PHP all day - good learning experience, but I'm tired!<br /><br />Thanks again.<br /><br />Jennifer<!--content-->
 
Back
Top