Forum Moderators: coopster

Message Too Old, No Replies

Confirmation Screen with a Form

         

johnnybt

4:57 am on Jan 22, 2004 (gmt 0)

10+ Year Member



Ok I have a form where users will enter about 4 fields.

When they hit submit they go to a confirmation screen using

Your Email - <?php echo $_POST["email"];?>

type lines to show what the user entered. I want them to then be able to hit submit again to email the results. My problem is that it seems when i use the echo to get to the confirmation screen i can't then use it again to get the information to mail.

jatar_k

5:13 am on Jan 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld johnnybt,

what I often do for reposting a form is to write the variables into hidden form elements. Then when they repost the variables are available.

Your Email - <?php echo $_POST["email"];?>
Your Name - <?php echo $_POST["fullname"];?>

<form name="someform" method="post" action="mailit.php">
<input type="hidden" name="email" value="<?php echo $_POST["email"];?>">
<input type="hidden" name="fullname" value="<?php echo $_POST["fullname"];?>">
<input type="submit" value="send it now">
</form>

something like that

johnnybt

5:26 am on Jan 22, 2004 (gmt 0)

10+ Year Member



*does a happy dance*

bingo, thanks man! now, of course, my problems don't stop there....

i've looked around but haven't found a definitive answer on the easiest way to make fields required on a php form.

oh, and when i get the emails they are from "apache" and email address of "apache@ensim.example.com"...what can i do about that?

[edited by: jatar_k at 6:27 am (utc) on Jan. 22, 2004]
[edit reason] generalized [/edit]

johnnybt

6:16 am on Jan 22, 2004 (gmt 0)

10+ Year Member



Nevermind, got that to work as well!

I have a MUCH bigger form issue, but I'll work on it for another day before enlisting help here!

Thanks!