Jump to content

Confirmation Page


E_Rock

Recommended Posts

Hello all,

Im making a Quote Request Form for my dads company. So first they have the actual form then they click submit and it going to a confirmation page so they can review their information, at the confirmation page i want the end user to be able to click confirm and it sends the form to my e-mail. and if they made a mistake to be able to click button saying go back and they just change the information. I tried to set it up that way but when i click submit, it says it submitted and i got the e-mail but none of the info was there, and the back button kept me on the confirmation page but erased all the data.

Link to comment
https://forums.phpfreaks.com/topic/217734-confirmation-page/
Share on other sites

Yeah sorry i wasnt on the right computer ...

 

process_bc.php

<html>
<body>
<?php
$name = $_POST['name'];
$company = $_POST['company'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$stock = $_POST['stock'];
$quantity = $_POST['quantity'];
$lots = $_POST['lots'];
$inkColor1 = $_POST['ink1'];
$inkColor2 = $_POST['ink2'];
$inkColor3 = $_POST['ink3'];
$inkColor4 = $_POST['ink4'];
$SSP = $_POST['secondsideprint'];
$registration = $_POST['regis'];
$bEmboss = $_POST['bEmboss'];
$fStamp = $_POST['fStamp'];
$fEmboss = $_POST['fEmboss'];
$bleeds = $_POST['bleeds'];
$rCorner = $_POST['rCorner'];
$dieCut = $_POST['dieCut'];
$comments = $_POST['comments'];

$name =stripslashes($name);
$company =stripslashes($company);
$email =stripslashes($email);
$phone =stripslashes($phone);


echo "Your quote request for ".$quantity." ".$stock." business cards has been processed<br /><br />";
echo "Thank you<br /><br /> ";

$to ="[email protected]";
$from ="$email";
$subject ="Business Card Quote Request from $name at $company";
$message="Business Card Quote Request from $company
Name: $name
E-Mail: $email
Company: $company
Phone #: $phone
Stock: $stock1
Quantity: $quantity
# of lots: $lots
Color 
1st: $inkColor1
2nd: $inkColor2
3rd: $inkColor3
4th: $inkColor4

Second Side Print: $SSP
Additional Options:
Registration: $registration
Blind Emboss: $bEmboss
Foil Stamp: $fStamp
Foil Emboss: $fEmboss
Bleeds: $bleeds
Round Corner: $rCorner
Die Cut: $dieCut

Additional Comments: $comments";

//Build $headers Variable
$headers = "From: $from\r\n";
$headers = "Content-type: text\r\n";
$to = "$to";
// Send the EMail
mail($to, $subject, $message, $headers);


?>
Please click <a href="newindex.html">here</a> to go back home.

</body>
</html>

 

businessConfirm.php

<?php

//Start Session
session_start();

//register session variables
session_register('name');
session_register('company');
session_register('email');
session_register('phone');
session_register('stock');
session_register('quantity');
session_register('lots');
session_register('ink1');
session_register('ink2');
session_register('ink3');
session_register('ink4');
session_register('secondsideprint');
session_register('regis');
session_register('bEmboss');
session_register('fStamp');
session_register('fEmboss');
session_register('bleeds');
session_register('rCorner');
session_register('dieCut');
session_register('comments');

//Store post values in the session variables
$_SESSION['name'] = $_POST['name'];
$_SESSION['company'] = $_POST['company'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['phone'] = $_POST['phone'];
$_SESSION['stock'] = $_POST['stock'];
$_SESSION['quantity'] = $_POST['quantity'];
$_SESSION['lots'] = $_POST['lots'];
$_SESSION['ink1'] = $_POST['ink1'];
$_SESSION['ink2'] = $_POST['ink2'];
$_SESSION['ink3'] = $_POST['ink3'];
$_SESSION['ink4'] = $_POST['ink4'];
$_SESSION['secondsideprint'] = $_POST['secondsideprint'];
$_SESSION['regis'] = $_POST['regis'];
$_SESSION['bEmboss'] = $_POST['bEmboss'];
$_SESSION['fStamp'] = $_POST['fStamp'];
$_SESSION['fEmboss'] = $_POST['fEmboss'];
$_SESSION['bleeds'] = $_POST['bleeds'];
$_SESSION['rCorner'] = $_POST['rCorner'];
$_SESSION['dieCut'] = $_POST['dieCut'];
$_SESSION['comments'] = $_POST['comments'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Business Card Quote Confirmation</title>
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<form action="process_bc.php" method="post">
<body>
<h2 class="style1">Contact Information:<br /></h2>
<span class="style1">Name: <?php echo $_SESSION["name"] ;?> <br />
Company: <?php echo $_SESSION["company"] ;?><br />
E-Mail: <?php echo $_SESSION["email"] ;?><br />
Phone Number: <?php echo $_SESSION["phone"] ;?><br />
</span>
<h2 class="style1">Quote Information:<br /></h2>
<p class="style1">Stock: <?php echo $_SESSION["stock"] ;?><br />
Quantity: <?php echo $_SESSION["quantity"] ;?><br />
# of Names: <?php echo $_SESSION["lots"] ;?><br />
Ink Color: <?php echo $_SESSION["ink1"] ;?><br />
2nd Ink Color: <?php echo $_SESSION["ink2"] ;?><br />
3rd Ink Color: <?php echo $_SESSION["ink3"] ;?><br />
4th Ink Color: <?php echo $_SESSION["ink4"] ;?><br />
Second Side Print: <?php echo $_SESSION["secondsideprint"] ;?><br />
Registration: <?php echo $_SESSION["regis"] ;?><br />
Blind Embossing: <?php echo $_SESSION["bEmboss"] ;?><br />
Foil Stamping: <?php echo $_SESSION["fStamp"] ;?><br />
Foil Embossing: <?php echo $_SESSION["fEmboss"] ;?><br />
Bleeds: <?php echo $_SESSION["bleeds"] ;?><br />
Round Corner: <?php echo $_SESSION["rCorner"] ;?><br />
Die Cut: <?php echo $_SESSION["dieCut"] ;?><br />
<br />
Additional Comments: <?php echo $_SESSION["comments"] ;?></p>
<table width="631" border="0" align="center">
  <tr>
    <td width="311"><div align="center" class="style1"><a href="businesscard.html"><input type="button" value="Go Back" /></a></div></td>

    <td width="310"><div align="center" class="style1"><input type="submit" value="Submit" /></div></td>
  </tr>
</table></form>

<p><br />
  <br />
  <br />
</p>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/217734-confirmation-page/#findComment-1130204
Share on other sites

Why dont you just use strip_tags/stripslashes on the $_POST vars instead of wasting memory reassigning them to vars: $name = strip_tags(stripslashes($_POST['name'])); this will reduce you code footprint and make it tidier too.

 

and the submit button needs a name -> name="submit" for it to know what its doing too.

 

Rw

Link to comment
https://forums.phpfreaks.com/topic/217734-confirmation-page/#findComment-1130221
Share on other sites

Why dont you just use strip_tags/stripslashes on the $_POST vars instead of wasting memory reassigning them to vars: $name = strip_tags(stripslashes($_POST['name'])); this will reduce you code footprint and make it tidier too.

 

and the submit button needs a name -> name="submit" for it to know what its doing too.

 

Rw

 

so if i do that what kind of code do i right for the confirmation page ?

Link to comment
https://forums.phpfreaks.com/topic/217734-confirmation-page/#findComment-1130223
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.