Ver Mensaje Individual
  #16 (permalink)  
Antiguo 14/08/2005, 20:08
Avatar de DvD AdN
DvD AdN
 
Fecha de Ingreso: mayo-2005
Ubicación: Frente al monitor
Mensajes: 610
Antigüedad: 19 años
Puntos: 0
Creas un contacto.php y le pones:
Código PHP:
if(isset($_POST['submit'])){
    if (empty($_POST['nombre']) || empty($_POST['apellido']) || empty($_POST['direccion']) || empty($_POST['email']) || empty($_POST['tel']) || empty($_POST['mensaje'])) {
    echo 'te falto algo'
    }else{
                $para = "tuemail@tuemail";
              $asunto = $_POST['nombre'].' '.$_POST['apellido'].'te envia un mensaje';
              $mensaje = $_POST['nombre'].' de '.$_POST['direccion'].' telefono '.$_POST['tel'].' te envia el siguiente mensaje'."\n".$_POST['mensaje'];
              $de = "From: $_POST['email'] \r\n";
                if (mail($para,$asunto,$mensaje,$de)){
                echo 'Gracias por tu mensaje';
                }else{
                echo 'Ha ocurrido un error';
                }
    }
}else{
?>
<form action="contacto.php" method="post">
Tu nombre:<input type="text" name="nombre" />
Apellido:<input type="text" name="apellido" />
Direccion:<input type="text" name="direccion" />
Tu e-mail:<input type="text" name="email" />
Telefono: <input type="text" name="tel" />
<textarea cols="40" rows="5" name="mensaje"></textarea>
<input type="submit" name="submit" value="Enviar" />
</form>
<?}?>
__________________
Keep f***ing learning
Ask for f***ing help.
Use f***ing spell check.
Think about all the f***ing possibilities.