Jump to content

Recommended Posts

Posted

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

Posted

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. :P

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...