Note that there are some explanatory texts on larger screens.

plurals
  1. POphp form review before email
    primarykey
    data
    text
    <p>I saw another subject relating to this but still was a little confuesed since I am still basic at PHP. So I have a form that posts to my Order.php. This sends the email and works just fine. I would like the form to post to Review.php then send. Below is my Order.PHP (i removed some of the input fields from the array since its rather long). I was thinking on the review.php I can just use all of the order.php code but instead of <code>$send = mail($to, $subject, $body, $headers);</code> I could just request <code>$to, $subject, $body, $headers</code> in some html then have a sumbit button that will send those to order.php that will be simplified since all the data is processed in the review page. Does that sound right?</p> <p>order.php is as follows</p> <pre><code>&lt;?php $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $to = "packy@mycompany.com"; $name = $_REQUEST['FitterName'] ; $from = $_REQUEST['FitterEmail'] ; $headers = "From: $from"; $subject = "Online Order"; $name2 = $_REQUEST['CustomerEmail'] ; $grind = join(", ", $_REQUEST["grind"]); $woods = join(", ", $_REQUEST["woods"]); $hybrids = join(", ", $_REQUEST["hybrids"]); $iron = join(", ", $_REQUEST["iron"]); $wedges = join(", ", $_REQUEST["wedges"]); $fields = array(); $fields{"AccountName"} = "Accounts's Name: "; $fields{"FitterName"} = "Fitter's Name: "; $fields{"CustomerCat"} = "__________________________CUSTOMER INFO__________________________"; $fields{"CustomerName"} = "Customer's Name: "; $fields{"CustomerPhone"} = "Customer's Phone: "; $fields{"CustomerAddress"} = "Customer's Address: "; $body = "We have received the following Online Order from www.mycompany.com:\n\n"; foreach($fields as $a =&gt; $b){ $body .= sprintf("%2s %s\n",$b,$_REQUEST[$a]); } $body2 = "Please Review the following Online Order from www.mycompany.com:\n\n"; foreach($fields as $a =&gt; $b){ $body2 .= sprintf("%2s %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@mycompany.com"; $subject2 = "Thank you for your order"; $autoreply = "Thank you for your order. Customer service will call in the next 24 hours to review your order."; $autoreply2 = "Company Customer"; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); $send3 = mail($name2, $subject2, $autoreply2, $headers2); if($send) {header( "Location: http://fitter.henry-griffitts.com/fitter/success.php" );} else {print "We encountered an error sending your mail, please review your information"; } } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload