hola chicoos, otra vez aqui, tengo el carrito terminado, instale phpmaile con gmail, pero no me manda los datos del carrito, solo el asunto y el mensaje, dejo aqui el codigo, llevo ya 3 dias intentandolo y no hay manera
aqui los datos de la compra
Código PHP:
Ver original<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO tblcompra (idCompra, idUsuario, fchFecha, intTipoPago, dblTotal, intEstado, strNombre) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['idCompra'], "int"),
GetSQLValueString($_POST['idUsuario'], "int"),
GetSQLValueString($_POST['fchFecha'], "date"),
GetSQLValueString($_POST['intTipoPago'], "text"),
GetSQLValueString($_POST['dblTotal'], "double"),
GetSQLValueString($_POST['intEstado'], "int"),
GetSQLValueString($_POST['strNombre'], "text"));
$insertGoTo = "carrito_finalizacion.php";
if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ?
"&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING'];
}
}
$maxRows_compra = 10;
$pageNum_compra = 0;
if (isset($_GET['pageNum_compra'])) { $pageNum_compra = $_GET['pageNum_compra'];
}
$startRow_compra = $pageNum_compra * $maxRows_compra;
$varCompra_compra = "0";
if (isset($_SESSION["MM_IdUsuario"])) { $varCompra_compra = $_SESSION["MM_IdUsuario"];
}
$query_compra = sprintf("SELECT * FROM tblcarrito WHERE tblcarrito.idUsuario = %s", GetSQLValueString
($varCompra_compra, "int")); $query_limit_compra = sprintf("%s LIMIT %d, %d", $query_compra, $startRow_compra, $maxRows_compra);
if (isset($_GET['totalRows_compra'])) { $totalRows_compra = $_GET['totalRows_compra'];
} else {
}
$totalPages_compra = ceil($totalRows_compra/$maxRows_compra)-1;
$preciototal="ObtenerIVA()/100";
$multiplicador = "ObtenerIVA()/100";
$valordelIVA = "preciototal * $multiplicador";
$valorconIVA = "preciototal * $multiplicador";
$Transferencia="Transferencia";
$asunto="Cachemira.com";
$mensaje="Gracias por comprar en la cachemira.com, a continuacion se su compra, esperamos verle pronto ";
$producto="idProducto";
?>
<td width="316" align="center" bgcolor="#EEEEEE"><strong>Resumen de su compra</strong></td>
</tr>
</table>
<form action="envio_realizado.php" method="post" name="form1" id="form1">
<table width="618" height="124" align="center">
<tr bgcolor="#00FFFF">
<td align="center">Productos</td>
<td align="center">Unidades</td>
<td colspan="2" align="center">Total </td>
</tr>
<?php $preciototal = 0;?>
<?php do { ?>
<tr bgcolor="#FFECEC" align="center">
<td width="186" align="right">
<input name="idProducto" type="text" value="<?php echo ObtenerNombreProducto($row_compra['idProducto']); ?>" size="10" /> </td>
<td width="102" align="right"><input type="text" name="idProducto" value="<?php echo $row_compra['intCantidad']; ?>" size="4" align="left" /></td>
<td colspan="2" align="center"><input name="idProducto" type="text" value="<?php echo ObtenerPrecioProducto($row_compra['idProducto']); ?>" size="5" /></td>
<?php $preciototal = $preciototal + ObtenerPrecioProducto($row_compra['idProducto']);?>
<td height="25" align="center">
</tr>
<tr>
<td height="29"></td> <td></td>
<td width="208" align="right" class="comproducto">
<?php
$multiplicador = (100 + ObtenerIVA())/100;
$valorconIVA = $preciototal * $multiplicador;
echo $valorconIVA;?>
<strong>Euros IVA incluido</strong></td>
</table>
<form id="formulario" method="post" action="recibido.php" enctype="multipart/form-data" name="formulario">
<input type="email" name="email" required>
<input type="hidden" name="idUsuario" value="<?php echo $_SESSION['MM_IdUsuario']; ?>" />
<input type="hidden" name="mensaje" value="<?php echo $mensaje?>">
<input type="hidden" name="fchFecha" value="<?php echo $hoy ?>" />
<input type="hidden" name="asunto" value="<?php echo $asunto ?>">
<input type="hidden" name="dblTotal" value="<?php
$multiplicador = (100 + ObtenerIVA())/100;
$valorconIVA = $preciototal * $multiplicador;
echo $valorconIVA;?>" />
<input id="submit" type="submit" name="enviar" value="Enviar mail">
</form>
aqui donde debe de recoger los datos y mandarlo al email
Código PHP:
Ver original<?php
//Librerías para el envío de mail
include_once('phpmailer/class.phpmailer.php');
include_once('phpmailer/class.smtp.php');
//Recibir todos los parámetros del formulario
$para = $_POST['email'];
$asunto = $_POST['asunto'];
$mensaje = $_POST['mensaje'];
$fchFecha= $_POST['fchFecha'] ;
$dblTotal= $_POST['dblTotal'] ;
//Este bloque es importante
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
//Nuestra cuenta
$mail->Password = 'xxxxxx; //Su password
//Agregar destinatario
$mail->AddAddress($para);
$mail->Subject = $asunto;
$mail->Body = $mensaje;
//Para adjuntar archivo
//$mail->AddAttachment($archivo['tmp_name'], $archivo['name']);
$mail->MsgHTML($mensaje,$fchFecha,$dblTotal);
//Avisar si fue enviado o no y dirigir al index
if($mail->Send())
{
echo'<script type="text/javascript">
alert("Enviado Correctamente");
window.location="final.php"
</script>';
}
else{
echo'<script type="text/javascript">
alert("NO ENVIADO, intentar de nuevo");
window.location="final.php"
</script>';
}
?>
solo manda esto
$asunto = $_POST['asunto'];
$mensaje = $_POST['mensaje'];