jsokolow Posted October 4, 2004 Posted October 4, 2004 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. 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? 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. TIA, Jennifer Quote
borfast Posted October 4, 2004 Posted October 4, 2004 Hi Jennifer. It really depends on how you have it working but from your description, I'd say the code should live in the PHP script. Here's what you need to know: PHP stores the values of submitted form elements in a global variable called $_POST. $_POST is actually an array, meaning it's kind of a variable container. 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']. 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']. 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) : ><html> <body> Hello <?php print $_POST['name']; ?>. The e-mail you submitted was <?php print $_POST['email']; ?> - is that correct? </body> </html> Give it a try and let me know if it helps. Quote
borfast Posted October 5, 2004 Posted October 5, 2004 Thanks, Steve. Just trying to help where I can, sharing the knowledge Quote
jsokolow Posted October 5, 2004 Author Posted October 5, 2004 Thanks! 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! Thanks again. Jennifer Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.