Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/02/2009, 09:43
armengual2
 
Fecha de Ingreso: septiembre-2003
Mensajes: 288
Antigüedad: 20 años, 7 meses
Puntos: 0
Respuesta: Alguien me podria ayudar con un formulario simple?

os pongo aqui como lo tengo a ver si veis el error el caso es que no me llegan los correos.

archivo html:
<html>
<body>

<img src="http://www.forosdelweb.com/f18/imagenes/contactar .jpg" width="760" height="576" />
<form id="enviar_mail" name="enviar_mail" method="post" action="enviacorreo.php">
<div id="Layer2">
<input name="nombre" type="text" id="nombre" size="42" class="tempo" />
</div>
<div id="Layer3">
<input name="telefono" type="text" id="telefono" size="42" maxlength="9" class="tempo" />
</div>
<div id="Layer4">
<input name="email" type="text" id="email" size="42" class="tempo" />
</div>
<div id="Layer5">
<textarea name="comentarios" cols="65" rows="7" id="comentarios" class="tempo"></textarea>
</div>
<div id="Layer6">
<select name="departamento" id="departamento">
<option value="[email protected]">Presidente</option>
<option value="[email protected]">Oficina</option>
<option value="[email protected]">Tesorería</option>
<option value="[email protected]">Director Tiro al Plato</option>
<option value="[email protected]">Director Tiro Pichón</option>
<option value="0" selected="selected">Seleccion el destino</option>
</select>
</div>
<div id="Layer7">
<input name="Enviar" type="submit" id="enviar" value="Enviar" />
</div>
<div id="Layer8">
<input name="limpiar" type="reset" id="limpiar" value="Limpiar " />
</div>
</FORM>

</body>
</html>


y este es el archivo php llamado enviacorreo.php:

<php>

<?

if (phpversion() >= "4.2.0") {
if ( ini_get('register_globals') != 1 ) {
$supers = array('_REQUEST',
'_ENV',
'_SERVER',
'_POST',
'_GET',
'_COOKIE',
'_SESSION',
'_FILES',
'_GLOBALS' );

foreach( $supers as $__s) {
if ( (isset($$__s) == true) && (is_array( $$__s
) == true) ) extract( $$__s, EXTR_OVERWRITE );
}
unset($supers);
}
} else {
if ( ini_get('register_globals') != 1 ) {

$supers = array('HTTP_POST_VARS',
'HTTP_GET_VARS',
'HTTP_COOKIE_VARS',
'GLOBALS',
'HTTP_SESSION_VARS',
'HTTP_SERVER_VARS',
'HTTP_ENV_VARS'
);

foreach( $supers as $__s) {
if ( (isset($$__s) == true) && (is_array( $$__s
) == true) ) extract( $$__s, EXTR_OVERWRITE );
}
unset($supers);
}
}



if($email=="")
{

echo "<script languaje=javascript>".
"alert(\"¡¡¡¡EL E-MAIL NO ES CORRECTO!!!!\");".
"location.href=\"contactar.html\";".
"</script>";

}


<select name="departamento" id="departamento">
<option value="[email protected]">Presidente</option>
<option value="[email protected]">Oficina</option>
<option value="[email protected]">Tesorería</option>
<option value="[email protected]">Director Tiro al Plato</option>
<option value="[email protected]">Director Tiro Pichón</option>
<option value="0" selected="selected">Seleccion el destino</option>
</select>


$asunto = "Formulario de Informacion Solicitada";


$encabezado = "From: $nombre <$email>";
$encabezado .= "\nReply-To: $email";
$encabezado .= "\nX-Mailer: PHP/" . phpversion();


$ip=$REMOTE_ADDR;


$mensaje .= "NOMBRE: $nombre\n";
$mensaje .= "Telefono: $telefono\n";
$mensaje .= "EMAIL: $email\n";
$mensaje .= "COMENTARIOS: $comentarios\n";

if($departamento == "0"){
echo "Selecciona un destino para el mensaje";
exit;
}



mail($_POST['departamento'], $_POST['asunto'], $_POST['mensaje']);


{
echo "<script languaje=javascript>".
"alert(\"THE MESSAGE COULD NOT BE COMMANDED!!!!\");".
"location.href=\"contactar.html\";".
"</script>";

}
else
{

echo "<script languaje=javascript>".
"alert(\"Su Mensaje se ha enviado Correctamente!!!!\");".
"location.href=\"../index.html\";".
"</script>";
}

?>
</php>

bueno eso es todo lo que tengoa ver si alguien me puede ayudar que llevo varios dias y no doy con la tecla , gracias y un salu2.