Link to home
Start Free TrialLog in
Avatar of rnobius
rnobius

asked on

Form mail Preview before submit ?

Hi all,

I have a form that gets inputs from the user and when hit submit, it sends 2 emails off.
Problem is, how can i do a preview of both emails before they are sent off?
When previewing, how can i go back to edit? and then preview and submit ?

Source here:
http://els.f2o.org/form.txt


Thanks
Avatar of nsanden
nsanden

Did you write this script yourself? If so you should know all you need to do is echo the form input on your page instead of mailing it when they hit the preview button.

Example:

<?php

if($_POST['action']=="mail") {

//Mail the form off
mail("firstemail,secondemail","subject","body");

} elseif($_POST['action']=="preview") {

//Don't mail it. Just print the stuff on the screen to preview it.
echo "something: " . $_POST['something'];
echo "somethingelse: " . $_POST['somethingelse'];
echo "<a href=javascript:history.back(-1)>back</a>";

}

?>

<form action=page.php method=POST>
<input name=something type=text>
<input name=somethingelse type=text>
<input name=action value=mail type=submit>
<input name=action value=preview type=submit >
</form>
ASKER CERTIFIED SOLUTION
Avatar of nsanden
nsanden

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial