Hi,
I would like to email the results of form input after it has been displayed on a page for review. Currently the steps are:
- Enter form and click button to "review order"
The following is the code that processes the input and either displays errors and asks the user to review and correct previous page or displays the order and asks user to finalize the order and submit it. I have the email being sent properly with the email.php file - but the variables are empty.... can anyone please help?
Thank you,
-Kara
<?php
$errors = ' ';
//append error message to previously defined $errors variables
if ( empty( $signname ) ) {
$errors .= "<li>Step 3: Please enter the personalization for your sign. </li>";
}
if ( empty( $doi ) ) {
$errors .= "<li>Step 3: Please enter a date for date of incident. </li>";
}
if ( empty( $age ) ) {
$errors .= "<li>Step 3: Please enter an age. </li>";
}
if ( empty( $shipname ) ) {
$errors .= "<li>Step 4: Please enter person's name to ship this order to. </li>";
}
if ( empty( $shipadd ) ) {
$errors .= "<li>Step 4: Please enter a valid address. </li>";
}
if ( empty( $shipcity ) ) {
$errors .= "<li>Step 4: Please enter a valid city. </li>";
}
if ( empty( $shipzip ) ) {
$errors .= "<li>Step 4: Please enter a valid zip code. </li>";
}
if ( empty( $shipphone ) ) {
$errors .= "<li>Step 4: Please enter a telephone number. </li>";
}
if ( empty( $shipemail ) ) {
$errors .= "<li>Step 4: Please enter a valid email address. </li>";
}
if (($shipemail) != ($cemail)) {
$errors .= "<li>Step 4: Your email addresses do not match. Please re-enter them again. </li>";
}
if ( !isset( $Agree ) ) {
$errors .="<li> Step 5: We can not process your order unless you have read and agree to our Terms of Agreement. </li>";
}
if ( $shipstate == 'AK' || $shipstate == 'HA' ){
$errors .="Sorry but we are unable to ship to Alaska and Hawaii at this time.";
}
?>
<?php
if ($errors =='0') {
echo 'There are errors with your form:'.'<br />'.$errors;
echo 'Please <a href="javascript: history.go(-1);"> correct the errors</a></p>';
} else {
echo '<h3>Please review your Order: '.'</h3>';
echo '<h4>'.'In Memory Sign: '.'</h4>';
echo 'Your Selected Sign is: '.$sign.'<br>';
echo 'Your Personalization will read as: '.$signname.'<br>';
echo 'The date of indicident entered is: '.$doi.'<br>';
echo 'The age has been entered as: '.$age.'<br>';
echo '<h4> Contact Information: </h4>';
echo 'Your order will be shipped to: <br>'.$shipname.'<br>';
echo $shipadd.' '.$shipadd2.'<br>'.$shipcity.', '.$shipstate.' '.$shipzip.'<br><br>';
echo 'Phone number supplied: '.$shipphone.'<br>';
echo 'Email address supplied: '.$shipemail.'<br>';
echo '<h4> Order Total: </h4>';
if ($price == '64.95') {
echo 'Your price without hardware: '.$price.'<br>';
} else {
echo 'Your price with hardware: '.$price.'<br>';
}
echo 'The Price for Shipping via UPS Ground is: '.$shipprice.'<br>';
echo 'Your total price is: '.'$<b>'.$total.'</b><br><br>';
echo '<b>Terms of Agreement: </b><p>
The intent of these signs is to inform passerby’s that a loved
one has been lost at a particular location. These signs are not to create
a memorial at road sides that may become a distraction in any way.</p>
<p class="style3">It is up to the responsible purchasing person to
determine a proper location and setting for any location or position
of any signs releasing any and all legal Liability and responsibilities
of ALDJ Enterprises L.L.C. Inmemorysigns.com</p>
<p class="style3">Every state, city or county has different laws or restrictions
that may apply to you where you are planning to display your sign.
Please check your local area before placing your order.</p>
<p class="style3">Due to the nature of this product, every sign is made
custom and personalized. So they can not be returned.<br><br>';
echo '<b>Order Policy: </b>'.'<p>'.'Due to the high costs of credit card management and credit card Fraud we will only accept checks or money orders. We have found this method very safe for both us and our customers. Please make your check or money order out and send it to: </p>
<center>ALDJ Enterprises LLC<br>
P.O. Box 696<br>
Warren, MI. 48090</center>
<p>Note: Once an order is placed we will continue to process the order through its stages as a check or money order clears. But please mail your payment immediately after placing an order, so the process can be completed and keep any delays to a minimum.</p>
<h4>Your Order is NOT yet processed</h4>
<p>Please <a href="javascript: history.go(-1);"> make necessary corrections to your order now.</a></p> Once you click the "Submit Your Order" button, you will not be able to make any corrections.
<p> An order confirmation will be sent to you via email upon clicking the submit your order button. Please make sure your email address is correct.</>';
}
?> <p>
<form action="includes/email.php" name='submit' method='post'>
<input type="submit" value="Submit Your Order" />
</form>
</p>