Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/01/2011, 10:03
Avatar de eits
eits
 
Fecha de Ingreso: junio-2005
Ubicación: valladolid, yucatán
Mensajes: 1.655
Antigüedad: 18 años, 10 meses
Puntos: 88
Respuesta: Código de Formulario

puedes intentar con esto
Código PHP:
Ver original
  1. ini_set("display_errors",1);//si no esta habilitado el despliegue de errores lo intentamos habilitar
  2. error_reporting(E_ALL);//para que nos indique los posibles errores si el ini_set tuvo exito
  3. if ($_POST) {
  4.     $message = 'Nombre: '.$_POST['nombre'].'<br />';
  5.     $message .= 'Empresa: '.$_POST['empresa'].'<br />';
  6.     $message .= 'E-mail: '.$_POST['email'].'<br />';
  7.     $message .= 'Pais: '.$_POST['pais'].'<br />';
  8.     $message .= 'Mensaje: '.$_POST['mensaje'];
  9.     if(mail( '[email protected]', 'Web Contact', $message )){
  10.         echo 'Formulario Enviado Correctamente';
  11.     else
  12.         echo 'Error de envio';
  13. }
en cuanto el html, me tomo la libertad de hacer unos cambios, espero y no te moleste
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <title> Formulario de Contacto </title>
  4. <style type="text/css" media="screen">
  5. form{
  6.     width:513px;
  7.     text-align:center;
  8. }
  9. label{
  10.     float:left;
  11.     font-weight:bold;
  12.     text-align:left;
  13.     width:200px;
  14. }
  15. .text{
  16.     margin-left:100px;
  17. }
  18. textarea{
  19.     margin-bottom:10px;
  20. }
  21. </head>
  22.  
  23. <!-- FORMULARIO -->
  24. <form method="post" action="contacto.php">
  25.     <label>Nombre:</label>
  26.     <input id="nombre" name="nombre" value="" size="55" type="text" class="text" />
  27.     <label>Empresa:</label>
  28.     <input id="empresa" name="empresa" value="" size="55" type="text" class="text" />
  29.     <label>E-mail:</label>
  30.     <input id="e-mail" name="email" value="" size="55" type="text" class="text" />
  31.     <label>País:</label>
  32.     <input id="pais" name="pais" value="" size="55" type="text" class="text" />
  33.     <label>Mensaje:</label>
  34.     <textarea id="mensaje" name="mensaje" cols="50" rows="6"></textarea>
  35.     <input type="submit" style="width:60%" value="Enviar" />
  36. </form>
  37. </body>
  38. </html>
saludos.
__________________
El amor es la locura mas lucida que tiene el hombre.- Andres Henestrosa
la tristeza no existe, solo es... la ausencia de la felicidad.