Solved

Form mail Preview before submit ?

Posted on 2003-12-03
2
457 Views
Last Modified: 2008-03-17
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
0
Comment
Question by:rnobius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 2

Expert Comment

by:nsanden
ID: 9872991
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>
0
 
LVL 2

Accepted Solution

by:
nsanden earned 155 total points
ID: 9873064
oops, slight modification...

<?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>";

} else {

?>

<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>

<?php } ?>
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question