Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/08/2002, 03:56
lcoll
 
Fecha de Ingreso: agosto-2002
Mensajes: 22
Antigüedad: 21 años, 8 meses
Puntos: 0
urgente por favor

hola de nuevo, he solucionado algun problema pero ahora lo que me pasa es que al hacer un submit del form no me lee las entradas del usuario,es decir, para que me funcione mail() tengo que definir las variables como constantes (quitar las // que he puesto delante de $to, $from... y no como valores entrador por el usuario que es lo que yo quiero. Ahi va mi trozo de programa en php que tengo dentro de mi htm

<?php
//$to = '[email protected]';
//$from = '[email protected]';
//$subject = "prueba";

//Check if we have something POSTed by the form.

if (!empty($HTTP_POST_VARS)&&($milio = "si")){
//Start with an empty body for the mail message
$body = '';
//Iterate through all the POSTed variables, and add them to the message body.
while (list($key, $value) = each($HTTP_POST_VARS)){
$body .= $key . ' = ' . $value . "";
}
//Build up some nice From/Reply Headers
$headers = "From: $from";
//$headers .= "Reply-To: $from";
//Mail the message out.
//Requires setting php3.ini sendmail path as per instructions

$success = mail($to, $subject, $body, $headers);
//Always check return codes from functions.
if ($success){
echo "<B><CENTER>se ha enviado un e-mail a la direccion :",$to,"</CENTER></B>";
}
else{
echo "<CENTER><B>Internal Error</B>: Your input was unprocessed.<BR>Contact $from</CENTER>";
}
}
?>
En mi form tengo inputs con el name="to", subject, from, mensaje,.. Por que no me los lee?
Alguna idea