Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/05/2010, 17:51
vereko
 
Fecha de Ingreso: mayo-2010
Mensajes: 7
Antigüedad: 14 años
Puntos: 0
Exclamación Notice: Undefined index: email in C:\wamp\www\mail.php on line 5

LLEGO AQUÍ CON ESPERANZA... de que alguien me ayude... POR FAVOR!!!

Cuento corto: es la primera vez que intento hacer funcionar un formulario creado en DW, con el correspondiente .php asociado, que se transforma en un nuevo .html dentro de mi página como respuesta. PERO NO LO LOGRO...

Les paso el código que la "teacher" del curso de DW nos facilitó para hipotéticamente hacer que las cosas nos funcionen...

(perdón que vaya con las anotaciones... pero así, de paso, ven lo que me dijeron...)

<!-- TODO LO QUE ESTA ACA ES CODIGO PHP que toma las variables del formulario de la página de formulario y lo arma para enviar por mail -->
<?php
// captura de variables se deben poner todas las variables que se crearon en el form y que se quieran enviar por mail, el nombre de la variable sale del atributo NAME de cada campo del formulario
$nombre=$_POST['nombre'];
$apellido=$_POST['apellido'];
$email=$_POST['email'];
$clave=$_POST['clave'];
$curso=$_POST['curso'];
$pais=$_POST['pais'];
$newsletter=$_POST['news'];
$comentario=$_POST['comentario'];

// cuerpo del email con los datos que se quieren enviar$mensaje="<strong>Nombre:</strong> $nombre<br /><br />
<strong>Apellido:</strong> $apellido<br /><br />
<strong>Email:</strong> $email<br /><br />
<strong>Pais:</strong> $pais<br /><br />
<strong>Curso al que se inscribe:</strong> $curso<br /><br />
<strong>Desea recibir newsletter?:</strong> $news<br /><br />
<strong>Consulta:</strong> $comentario<br /><br />";

// envío del email
mail("[email protected]", "Consulta Web Site", $mensaje, "From: $nombre <$email>\nReply-To:$email\nContent-Type: text/html; charset=iso-8859-1\n");
?>

<!-- HASTA ACA LLEGA EL CODIGO PHP -->
<!-- ESTO ES LA PAGINA WEB QUE VE LA PERSONA LUEGO QUE COMPLETA EL FORM Y QUE LE DA LAS GRACIAS se puede poner todo el diseño de la web que uno está armando -->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="estilos.css" rel="stylesheet" type="text/css" />
</head>

<body STYLE="background-color:transparent">
<table width="760" height="237" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" style="padding:29 30 0 110"><span class="texto_bold" style="padding-right:10px">&iexcl;&iexcl; Gracias <?php echo($nombre); ?> por su consulta !!<br>
a la brevedad nos pondremos en contacto.</span></td>
</tr>
</table>
</body>
</html>

LUEGO DE MI INTERVENCIÓN, mi código php quedó de la siguiente manera:
(quedan las anotaciones porque sino, me pierdo !!!)

<?php
// captura de variables se deben poner todas las variables que se crearon en el form y que se quieran enviar por mail, el nombre de la variable sale del atributo NAME de cada campo del formulario
$nombre=$_POST['nombre'];
$email=$_POST['email'];
$fecha=$_POST['fecha'];

// cuerpo del email con los datos que se quieren enviar
$mensaje="<strong>Nombre:</strong> $nombre<br /><br />
<strong>Email:</strong> $email<br /><br />
<strong>Fecha:</strong> $fecha<br /><br />";

// envío del email
mail("[email protected]", "Consulta Web Site", $mensaje, "From: $nombre <$email>\nReply-To:$email\nContent-Type: text/html; charset=iso-8859-1\n");
?>

¿ESTÁ BIEN HASTA ACÁ LA COSA?


PORQUE EL ASUNTO ES QUE NO FUNCIONA...
Me bajé el Wampserver (tengo W Vista) y encontré por ahí, en otro foro, la indicación de que también tenía que bajar el MINIRELAY... y lo hice...

Y cargado el sitio en la carpeta www del Wampserver, cuando relleno el formulario y presiono SEND, ahora, me sale el siguiente error:

Notice: Undefined index: email in C:\wamp\www\mail.php on line 5

La línea 5 es la que dice

$email=$_POST['email'];



ANTES ME FUE DANDO ERRORES EN DISTINTAS LÍNEAS... y no termino de entender que es lo que está mal...

¿ALGUIEN TIENE LA SUFICIENTE PACIENCIA PARA DECIRME QUÉ DEBO HACER?

¿Qué es lo que está mal luego?

GRACIAS A QUIEN TENGA VOLUNTAD DE AYUDAR!!!

SALUDOS
Verónica