Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2004, 09:00
tmh4mail
 
Fecha de Ingreso: junio-2004
Mensajes: 71
Antigüedad: 19 años, 10 meses
Puntos: 1
Problema con la confirmacion en email

Primero Saludos A Todos.

Soy Nuevo & el Foro y tambien en esto de PHP.

Hice una pagina donde los clientes puden hacer su pedido cuando completan la orden el cliente y el vendedor necesitan recibir un email con la confirmacion de la orden, el cual esta trabajando bien. El problema es que el email solo inqluye la informacion que ponen antes de ordenar. Nombre, Direccion, Tel. etc...

Pero no incluye los productos que pidieron en la pagina Anterior. este es un demo que puse para que si quieren pueden usarlo para que miren aque me refiero. Solo voy a poner una parte porque es muy grande.

este es un demo puden usarla para que miren aque me refiero.
http://www.themailinghouse.com/demo/demo.php

Hojala que alguien Ilumine mi dia.

//este es el script de la democart.php

<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {color: #FF0000}
-->
</style>
<form method="POST" action="checkoutdemo.php" onsubmit="return FrontPage_Form2_Validator(this)" language="JavaScript" name="FrontPage_Form2" webbot-action="--WEBBOT-SELF--">
<div align="center">
<table width="725" align="center">
<tr valign="bottom" bgcolor="#FF0000">
<th colspan="7" scope="col"><div align="center" class="style1"></div>
<div align="center" class="style1"></div>
<div align="center" class="style1"></div>
<div align="center" class="style1"><span class="style25">BROCHURES</span></div></th>
</tr>
<tr>
<th width="58" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Iment </span></th>
<th width="183" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Description</span></th>
<th width="41" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Qty</span></th>
<td width="138"><span class="style1">
<?php
$ItemQA031= $_POST['ItemQA031'];
$Desc1= $_POST['Desc1'];
$Qty1= $_POST['Qty1'];
$ItemQA033= $_POST['ItemQA033'];
$Desc2= $_POST['Desc2'];
$Qty2= $_POST['Qty2'];
$ItemQA058= $_POST['ItemQA058'];
$Desc3= $_POST['Desc3'];
$Qty3= $_POST['Qty3'];

?>

</span></td>
<th width="58" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Iment </span></th>
<th width="179" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Description</span></th>
<th width="36" nowrap bgcolor="#FF0000" scope="col"><span class="style3 style1">Qty</span></th>
</tr>
<tr valign="baseline">
<td nowrap><p align="left" class="style24 style30 style20 style22"><span class="style26">
<? if ($Qty1 > 0) print $ItemQA031;?>
</span></p>
<p align="left" class="style24 style30 style20 style22"><span class="style26 ">
<? if ($Qty2 > 0) print $ItemQA033;?>
</span> </p>
<p align="left" class="style24 style30 style20 style22"><span class="style26">
<? if ($Qty3 > 0) print $ItemQA058;?>

//este es el final de democart.php

</span></span> </p></td>
</tr>
<tr>
<td colspan="7">
<hr size="1" color="red" NOSHADE>
<p align="center"><font class="blacktext"><b>Please fill out the following information below to complete your order.</b> </font> </p>
<p align="center"> <b><font class="greetext style26 style2">Qantas Rep:</font></b>
<TABLE class="blacktext">
<TR>
<TD><div align="right"></div></TD>
<TD>
<div align="center">ID :
<input name="idno" type="text" id="idno" size="15">
</div></TD>
</TR>
<TR>
<TD><div align="right">First Name:</div></TD>
<TD><input name="first" type="text" id="first" size="15">
Last Name:
<input name="last" type="text" id="last" size="15">
</TD>
</TR>
<TR>
<TD><div align="right">Email:</div></TD>
<TD><input type="text" size="37" name="s_email"></TD>
</TR>
<TR>
<TD>Today's Date :</TD>
<TD><input name="today" type="text" id="today" size="12">
Date Needed :
<input name="need" type="text" id="need2" size="12"></TD>
</TR>
</TABLE>
<p align="center">
<p align="center">
<p align="center"><b><font class="style2">Ship items to:</font></b>
<TABLE class="blacktext">
<TR>
<TD><div align="right">First Name : </div></TD>
<TD><input type="text" size="18" name="s_first">
Last Name :
<input type="text" size="15" name="s_last"></TD>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<P align="center">
</form>
<p class="style10">&nbsp;</p>

//este es todo el script de checkoutdemo.php..

<?php
$header = "header.html";
$footer = "footer.html";
$returnpage = "/qantas/qantas.php";
$youremail = "[email protected]";
$mode = "BOTH";

function doFormError($errString) {

include($header);

echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
echo "$errString<BR><BR>\n";
echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";

include($footer);

exit;
}

function doError($errString) {

include($header);

echo "$errString<BR><BR>\n";

include($footer);

exit;
}

$idno= $_POST['idno'];
$first= $_POST['first'];
$last= $_POST['last'];
$today= $_POST['today'];
$need= $_POST['need'];
$s_first= $_POST['s_first'];
$s_last= $_POST['s_last'];
$ItemQA031= $_POST['ItemQA031'];
$Desc1= $_POST['Desc1'];
$Qty1= $_POST['Qty1'];
$ItemQA033= $_POST['ItemQA033'];
$Desc2= $_POST['Desc2'];
$Qty2= $_POST['Qty2'];
$ItemQA058= $_POST['ItemQA058'];
$Desc3= $_POST['Desc3'];
$Qty3= $_POST['Qty3'];


if (($first == "") || ($last == "") || ($today == "") || ($need == "")) {
doFormError("I'm sorry, but it appears that you forgot to fill in a required field. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}

if( !(ereg("^(.+)@(.+)\\.(.+)$",$s_email)) ) {
doFormError("You submitted an invalid email address. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}



$invoice = date ("ymdHis");
$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "A new order has been received. A summary of this order appears below.\n";
$strMessageBody .= "\n";
$strMessageBody .= "Order Date: $today \n";
$strMessageBody .= " \n";
$strMessageBody .= "Invoice #: $idno$invoice \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qantas Rep: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $first $last \n";
$strMessageBody .= " Need By: $need \n";
$strMessageBody .= " FedEx #: $fedex \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Ship To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $s_first $s_last \n";
$strMessageBody .= " $s_addr $s_addr2 \n";
$strMessageBody .= " $s_city, $s_state $s_zip \n";
$strMessageBody .= " $s_phone \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qty Product ID - Product Name\n";
$strMessageBody .= "================================================= ==================== \n\n";
if( $Qty1 ) {$strMessageBody .= "$Qty1 $ItemQA031 - $Desc1 \n";}
if( $Qty2 ) {$strMessageBody .= "$Qty2 $ItemQA033 - $Desc2 \n";}
if( $Qty3 ) {$strMessageBody .= "$Qty3 $ItemQA058 - $Desc3 \n";}
$strMessageBody .= "================================================= ==================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n";
//$strMessageBody .= "FREIGHT: $SHIPPING \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Comments: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";


if( $mode == "BOTH" || $mode == "EMAIL") {
$mailheaders = "From: $s_email\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:The Mailing House Inc.®\r\n";
$subject = "New Online Order";
mail($youremail, $subject, $strMessageBody, $mailheaders);


//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:The Mailing House Inc.®\r\n";
$subject = "Order Confirmation";
mail($s_email, $subject, $strMessageBody, $mailheaders);
}

echo "<h2>Thank you</h2>";
echo "Thank you for your oline order. You will receive a confirmation email of your order ";
echo "momentarily. Please contact us at $youremail if you have any questions or concerns.";
echo "<P>";
echo "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
echo "<P>";


?>

Última edición por tmh4mail; 24/06/2004 a las 09:03