vereis, hice una minitienda de prueba con el ya conocido programa
cibertienda lo subo a mi servidor que soporta php (iespana) y todo parece funcionar correctamente, sólo que al enviar el formulario me llega un mail con lo siguiente:
Civertienda v1.0 - Orden de Compra
REMOTE HOST:
REMOTE USER:
REMOTE ADDR: 213.9.250.143
es decir no incluye los datos del formulario ni del pedido
esto es del formulario:
<html>
<head>
<title>Orden de Compra</title>
<link rel="stylesheet" href="estilo.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--
function Enviar(form) {
for (i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "text" && form.elements[i].value == "") {
alert("Por favor complete todos los campos del formulario"); form.elements[i].focus();
return false; }
}
form.submit();
}
// -->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" class="body">
<SCRIPT LANGUAGE="JavaScript">
function alterError(value) {
if (value<=0.99) {
newPounds = '0';
} else {
newPounds = parseInt(value);
}
newPence = parseInt((value+.0008 - newPounds)* 100);
if (eval(newPence) <= 9) newPence='0'+newPence;
newString = newPounds + '.' + newPence;
return (newString);
}
function showItems() {
index = document.cookie.indexOf("TheBasket");
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
fulllist = document.cookie.substring(countbegin, countend);
totprice = 0;
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
itemstart = i+1;
} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
var tax = itemtotal / 100 * (0 - 0);
tax = Math.floor(tax * 100)/100
totprice = totprice + itemtotal + tax;
itemlist=itemlist+1;
document.writeln('<INPUT TYPE="hidden" NAME="Producto'+itemlist+'" VALUE="'+theitem+'" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="Cantidad'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">')
document.writeln('<INPUT TYPE="hidden" NAME="ProductoTotal'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">');
} else if (fulllist.substring(i,i+1) == ',') {
theitem = fulllist.substring(itemstart, i);
itemstart = i+1;
} else if (fulllist.substring(i,i+1) == '#') {
theprice = fulllist.substring(itemstart, i);
itemstart = i+1;
}
}
document.writeln('<INPUT TYPE="hidden" NAME="Total" VALUE="'+alterError(totprice)+'" SIZE="40">');
}
function Total() {
document.writeln(alterError(totprice));
}
</SCRIPT>
<center>
<table border="0" cellpadding="0" cellspacing="0" width="640" class="body">
<tr>
<td width="50%"><big><big>Orden de Compra</big></big></td>
<td width="50%" align="right">[ <a href="carrito.htm">Carrito</a> | <a href="estado.htm">Estado</a> | Orden de Compra ]</td>
</tr>
<tr>
<td width="100%" colspan="2">
<hr size="1" color="#000000">
</td>
</tr>
<tr>
<td width="100%" colspan="2">Esta página debería estar alojada en un servidor seguro:</td>
</tr>
</table>
<FORM method="post" action="enviar.php" target="_top">
<table cols="2" width="370" class="body">
<td width="130"></td>
<td width="270">
</td>
</tr>
<tr><td>Nombre:</td><td><input type="text" name="nombre" size=34></td></tr>
<tr><td>Apellido:</td><td><input type="text" name="apellido" size=34></td></tr>
<tr><td>Telefono:</td><td><input type="text" name="telefono" size=34></td></tr>
<tr><td>E-mail:</td><td><input type="text" name="email" size=34></td></tr>
<SCRIPT LANGUAGE="JavaScript">
showItems();
</SCRIPT>
<tr>
<td>Total:</td>
<td>$
<SCRIPT LANGUAGE="JavaScript">Total()</SCRIPT>
</td>
</tr>
<tr>
<td><br><br></td>
<td>
<input type="button" value="Enviar" onClick="return Enviar(this.form)">
<input type="reset" value="Restablecer">
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
y esto de enviar.php
<?
$MailToAddress = "
[email protected]";
$MailSubject = "Cibertienda";
if (!$MailFromAddress) {
$MailFromAddress = "
[email protected]";
}
$Header = "Civertienda v1.0 - Orden de Compra";
$Footer = "";
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
$Message .= "$key = $val\n";
}
if ($Header) {
$Message = $Header."\n\n".$Message."\n\n";
}
$Message .= "REMOTE HOST: ".$REMOTE_HOST."\n";
$Message .= "REMOTE USER: ". $REMOTE_USER."\n";
$Message .= "REMOTE ADDR: ". $REMOTE_ADDR."\n";
if ($Footer) {
$Message .= "\n\n".$Footer;
}
mail( "$MailToAddress", "$MailSubject", "$Message", "From: $MailFromAddress");
header ("Location:
http://www.buceoprofesional.org");
?>