Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/10/2004, 20:32
GermanBsAs
 
Fecha de Ingreso: septiembre-2004
Mensajes: 252
Antigüedad: 19 años, 6 meses
Puntos: 0
si, php y cgi son las mejores opciones para la funcion "action="


Este seria el codigo para un formulario en alguna pagina html cualquiera,

Código HTML:
<form name="form1" method="post" action="enviar.php">
  <table width="400" border="0">
    <tr>
      <td colspan="2">
        <p align="center"><b><font face="Arial" size="2">Contacto</font></p>
        </b></td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2">Nombre</font></td>
      <td width="70%">
        <input type="text" name="name" size="20" style="font-family: Tahoma; font-size: 8 pt; color: #000000; border: 1 solid #000000">
      </td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2">E-mail</font></td>
      <td width="70%">
        <input type="text" name="email" size="20" style="font-family: Tahoma; font-size: 8 pt; color: #000000; border: 1 solid #000000">
      </td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2">Asunto</font></td>
      <td width="70%">
        <input type="text" name="subject" size="20" style="font-family: Tahoma; font-size: 8 pt; color: #000000; border: 1 solid #000000">
      </td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2">Mensaje</font></td>
      <td width="70%">
        <textarea rows="4" name="message" style="font-family: Tahoma; font-size: 8 pt; color: #000000; border: 1 solid #000000" cols="49"></textarea>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <font face="Arial" size="2">
        <input type="submit" name="submit" value="Send">
        </font>
      </td>
    </tr>
  </table>
</form> 

Y esta sería la pagina de enviar.php

Código PHP:
<?

$mail 
""//Tu direccion de mail (No te olvides)
$yourname ""//Tu nombre

mail("$mail""$subject""
Hola $yourname,

Tienes correo de:
Nombre: $name
E-mail: $email.
IP: $REMOTE_ADDR

Este es el mensaje:
$message

Adios $yourname"
"From: $name<$email>\nReturn-path: $email");

echo 
"Se ha enviado su mensaje.<br>";
echo 
"Muchas gracias.<br>";


?>