...

View Full Version : Send form data from product select page to order form page?



David4321
03-04-2009, 12:10 AM
I need to get the product selection data (just the item #) from the catalog page where the user clicks the button, to be included on the same form mail that goes out upon submission of the order form on the next page. How can I get the data from the product page to the order form page? (or otherwise made a part of the data to be sent by form mail)

I don't actually know any php, mostly html. Please respond through providing info about what method would usually be used, and if possible a complete script, a link to one, or the right search terms for me to find one.

Thanks...

sea4me
03-04-2009, 01:56 AM
Can you please post the code of the product page?

David4321
03-04-2009, 03:21 AM
This is an example of the simple product page. This page just has the product images and purchase button - it displays in an inline frame on the catalog page in response to the users other choices. I have not yet customized the form. The outcome should be: button loads the order form page, and sends the item # (only 1 item per product page like this) forward to it, or otherwise gets that data onto the form mail.

Thank you for looking.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<style type="text/css">
div#container
{
width: 376px;
position: relative;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
body
{
text-align: center;
margin: 0;
}
</style>
<style type="text/css">
a:visited
{
color: #0000FF;
}
a:active
{
color: #0000FF;
}
</style>
<style type="text/css">
img { behavior: url("pngfix.htc"); }
</style>
</head>
<body bgcolor="#000000" text="#FFFFFF" style="background-position:center top ;">
<div id="container">
<div id="wb_Form1" style="position:absolute;left:19px;top:440px;width:342px;height:91px;z-index:0" align="left">
<form name="Form_selection" method="post" action="mailto:your.email@email.com" enctype="text/plain" id="Form1">

</form>
</div>
<div id="wb_Image1" style="overflow:hidden;position:absolute;left:16px;top:17px;z-index:1" align="left">
<img src="images/B-greenleaf-A3_340.jpg" id="Image1" alt="" align="top" border="0" style="width:340px;height:195px;"></div>
<div id="wb_Image2" style="overflow:hidden;position:absolute;left:16px;top:227px;z-index:2" align="left">
<img src="images/B-red-A3-L_340.jpg" id="Image2" alt="" align="top" border="0" style="width:340px;height:195px;"></div>
<div id="wb_RollOver1" style="position:absolute;left:41px;top:450px;width:290px;height:70px;z-index:3" align="left">
<script language="JavaScript" type="text/javascript">
<!--
RollOver1 = new Image();
RollOver1.src = "images/Buy-Now-buttonRG-roll.png";
//-->
</script>
<a href="./order.html" target="_parent">
<img src="images/Buy-Now-buttonRG.png" id="RollOver1" width="290" height="70" alt="" border="0" onMouseOver="this.src='images/Buy-Now-buttonRG-roll.png'" onMouseOut="this.src='images/Buy-Now-buttonRG.png'">
</a>
</div>
</div>
</body>
</html>

sea4me
03-04-2009, 04:02 AM
Well since ur form has a image as a submit I haven't tried that yet but I know that it will work...

Well you need a hidden in your form with the order id or something

Ex:

<form method="post" action="orderform.php">
<input name="item" type="hidden" value="YOUR ORDER ID OR SOMETHING HERE!!!!" />
<input name="order" type="submit" value="Submit" />
</form>

In your orderform.php:


if(isset($_POST['order'])){
$item = $_POST['item'];
// do some db pulls or is it static? if not, do some db pulls to get the items and price here
$message = "Someone has ordered " . $item . " from your shop.";
mail('YOUR@EMAIL.COM', 'My Subject', $message);
}


Hope that was what u were looking for :thumbsup:

sea4me
03-04-2009, 04:05 AM
Ok so the form image thing would be like:


<form method="post" action="orderform.php">
<input name="item" type="hidden" value="YOUR ORDER ID OR SOMETHING HERE!!!!" />
<input type="image" src="images/Buy-Now-buttonRG.png" id="RollOver1" width="290" height="70" alt="" border="0" onMouseOver="this.src='images/Buy-Now-buttonRG-roll.png'" onMouseOut="this.src='images/Buy-Now-buttonRG.png'" alt="Order">
</form>

Then ur orderform.php:

if(isset($_POST['RollOver1'])){
$item = $_POST['item'];
// do some db pulls or is it static? if not, do some db pulls to get the items and price here
$message = "Someone has ordered " . $item . " from your shop.";
mail('YOUR@EMAIL.COM', 'My Subject', $message);
}

David4321
03-04-2009, 07:33 AM
Thanks for your responses.

If I understand you correctly, what you're describing is creating a separate form mailer for this item page, and the email would only contain the data from this page.

If so, that won't work here.

There is already a form mailer generating the order email from the order form page. I use the godaddy gdform.php for that right now. There is a lot of information the user fills out, and this one piece (the item number) has to become a part of the existing form mail.

Is there a way to send this item data forward to the order form page, so it can be included in the existing order email?

I know I've seen this before: you fill out something in a form on one page, and when you continue, the next page knows what you entered, or has it pre-filled in. I'm thinkng maybe the item # could be sent to a hidden field on the actual order form... or ???

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum