Im seguro su un error estúpido...

  • georanson
  • Beginner
  • Beginner
  • Avatar de Usuario
  • Registrado: Ago 10, 2007
  • Mensajes: 53
  • Loc: florida
  • Status: Offline

Nota Junio 12th, 2011, 8:20 pm

Error de análisis: error de sintaxis, T_VARIABLE inesperado en D:\Hosting\4952260\html\wp-includes\email.php en línea 4

Me siento como un idiota para pedir sino para la vida de mí que no puedo averiguar lo que es ese error

PHP Código: [ Select ]
 
<?php
if(isset($_POST['email'])) {
     
    $email_to ="georanson@gmail-com";
    $email_subject = "Contact Form";
     
     
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    }
     
    // validation expected data exists
    if(!isset($_POST['first_name']) ||
        !isset($_POST['last_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['telephone']) ||
        !isset($_POST['comments'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');      
    }
     
    $first_name = $_POST['first_name']; // required
    $last_name = $_POST['last_name']; // required
    $email_from = $_POST['email']; // required
    $telephone = $_POST['telephone']; // not required
    $comments = $_POST['comments']; // required
     
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$first_name)) {
    $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  }
  if(!preg_match($string_exp,$last_name)) {
    $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  }
  if(strlen($comments) < 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  }
  if(strlen($error_message) > 0) {
    died($error_message);
  }
    $email_message = "Form details below.\n\n";
     
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }
     
    $email_message .= "First Name: ".clean_string($first_name)."\n";
    $email_message .= "Last Name: ".clean_string($last_name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Telephone: ".clean_string($telephone)."\n";
    $email_message .= "Comments: ".clean_string($comments)."\n";
     
 
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers); 
?>
 
<!-- include your own success html here -->
 
Thank you for contacting us. We will be in touch with you very soon.
 
<?php
}
?>
 
  1.  
  2. <?php
  3. if(isset($_POST['email'])) {
  4.      
  5.     $email_to ="georanson@gmail-com";
  6.     $email_subject = "Contact Form";
  7.      
  8.      
  9.     function died($error) {
  10.         // your error code can go here
  11.         echo "We are very sorry, but there were error(s) found with the form you submitted. ";
  12.         echo "These errors appear below.<br /><br />";
  13.         echo $error."<br /><br />";
  14.         echo "Please go back and fix these errors.<br /><br />";
  15.         die();
  16.     }
  17.      
  18.     // validation expected data exists
  19.     if(!isset($_POST['first_name']) ||
  20.         !isset($_POST['last_name']) ||
  21.         !isset($_POST['email']) ||
  22.         !isset($_POST['telephone']) ||
  23.         !isset($_POST['comments'])) {
  24.         died('We are sorry, but there appears to be a problem with the form you submitted.');      
  25.     }
  26.      
  27.     $first_name = $_POST['first_name']; // required
  28.     $last_name = $_POST['last_name']; // required
  29.     $email_from = $_POST['email']; // required
  30.     $telephone = $_POST['telephone']; // not required
  31.     $comments = $_POST['comments']; // required
  32.      
  33.     $error_message = "";
  34.     $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  35.   if(!preg_match($email_exp,$email_from)) {
  36.     $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  37.   }
  38.     $string_exp = "/^[A-Za-z .'-]+$/";
  39.   if(!preg_match($string_exp,$first_name)) {
  40.     $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  41.   }
  42.   if(!preg_match($string_exp,$last_name)) {
  43.     $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  44.   }
  45.   if(strlen($comments) < 2) {
  46.     $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  47.   }
  48.   if(strlen($error_message) > 0) {
  49.     died($error_message);
  50.   }
  51.     $email_message = "Form details below.\n\n";
  52.      
  53.     function clean_string($string) {
  54.       $bad = array("content-type","bcc:","to:","cc:","href");
  55.       return str_replace($bad,"",$string);
  56.     }
  57.      
  58.     $email_message .= "First Name: ".clean_string($first_name)."\n";
  59.     $email_message .= "Last Name: ".clean_string($last_name)."\n";
  60.     $email_message .= "Email: ".clean_string($email_from)."\n";
  61.     $email_message .= "Telephone: ".clean_string($telephone)."\n";
  62.     $email_message .= "Comments: ".clean_string($comments)."\n";
  63.      
  64.  
  65. $headers = 'From: '.$email_from."\r\n".
  66. 'Reply-To: '.$email_from."\r\n" .
  67. 'X-Mailer: PHP/' . phpversion();
  68. @mail($email_to, $email_subject, $email_message, $headers); 
  69. ?>
  70.  
  71. <!-- include your own success html here -->
  72.  
  73. Thank you for contacting us. We will be in touch with you very soon.
  74.  
  75. <?php
  76. }
  77. ?>
  78.  
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Junio 12th, 2011, 8:20 pm

  • demonmaestro
  • Gold Member
  • Gold Member
  • Avatar de Usuario
  • Registrado: Jun 21, 2006
  • Mensajes: 477
  • Loc: Conroe, Texas
  • Status: Online

Nota Junio 12th, 2011, 8:25 pm

Código: [ Select ]
<?php
if(isset($_POST['email'];)) {
  1. <?php
  2. if(isset($_POST['email'];)) {


el espacio y añadir el; y que debe fijar...
Thanks, Josh --DemonMaestro
www.LilNetwork.com
Fun Website www.ShoutsCloud.com
  • georanson
  • Beginner
  • Beginner
  • Avatar de Usuario
  • Registrado: Ago 10, 2007
  • Mensajes: 53
  • Loc: florida
  • Status: Offline

Nota Junio 12th, 2011, 8:33 pm

me dio un nuevo error
Error de análisis: error de sintaxis, inesperado; esperaba, o) en D:\Hosting\4952260\html\wp-includes\email.php en línea 2
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Junio 12th, 2011, 9:04 pm

Problema #1 (no su problema)
PHP Código: [ Select ]
    // validation expected data exists
    if(!isset($_POST['first_name']) ||
        !isset($_POST['last_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['telephone']) ||
        !isset($_POST['comments'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');      
    }
     
    $first_name = $_POST['first_name']; // required
    $last_name = $_POST['last_name']; // required
    $email_from = $_POST['email']; // required
    $telephone = $_POST['telephone']; // not required
    $comments = $_POST['comments']; // required
  1.     // validation expected data exists
  2.     if(!isset($_POST['first_name']) ||
  3.         !isset($_POST['last_name']) ||
  4.         !isset($_POST['email']) ||
  5.         !isset($_POST['telephone']) ||
  6.         !isset($_POST['comments'])) {
  7.         died('We are sorry, but there appears to be a problem with the form you submitted.');      
  8.     }
  9.      
  10.     $first_name = $_POST['first_name']; // required
  11.     $last_name = $_POST['last_name']; // required
  12.     $email_from = $_POST['email']; // required
  13.     $telephone = $_POST['telephone']; // not required
  14.     $comments = $_POST['comments']; // required

En el comentario del número de teléfono, usted dice que no es necesario y aún se hacen necesarios comprobando si existe en el si declaración justo por encima de él.

A por qué está recibiendo ese error, que está más allá de mi...que el error es debido a un problema con el código escrito antes de...si sólo se muestran un poco de un archivo, registrar algunas líneas antes de la línea con el error...todo se ve bien lo es ahora...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • demonmaestro
  • Gold Member
  • Gold Member
  • Avatar de Usuario
  • Registrado: Jun 21, 2006
  • Mensajes: 477
  • Loc: Conroe, Texas
  • Status: Online

Nota Junio 12th, 2011, 9:31 pm

bien puede ser estúpido pero sólo intente tomar nuevamente el; y añadir un espacio entre el = y el "como esto.

$email_to = "georanson@gmail-com";

y no el correo electrónico debe @gmail.com no @ gmail-com??? lol
Thanks, Josh --DemonMaestro
www.LilNetwork.com
Fun Website www.ShoutsCloud.com
  • georanson
  • Beginner
  • Beginner
  • Avatar de Usuario
  • Registrado: Ago 10, 2007
  • Mensajes: 53
  • Loc: florida
  • Status: Offline

Nota Junio 12th, 2011, 9:35 pm

sí sé que el correo electrónico es .com pero el foro me dijo mi correo fue un vínculo y me deja puesto y il intente
  • georanson
  • Beginner
  • Beginner
  • Avatar de Usuario
  • Registrado: Ago 10, 2007
  • Mensajes: 53
  • Loc: florida
  • Status: Offline

Nota Junio 12th, 2011, 9:37 pm

aún el mismo error. el archivo se encuentra en su propia conecta a otro archivo html pero eso es
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Junio 12th, 2011, 10:09 pm

Línea 4 es:
PHP Código: [ Select ]
    $email_to ="georanson@gmail-com";

¿Corregir?
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • georanson
  • Beginner
  • Beginner
  • Avatar de Usuario
  • Registrado: Ago 10, 2007
  • Mensajes: 53
  • Loc: florida
  • Status: Offline

Nota Junio 13th, 2011, 5:34 am

corregir
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • Avatar de Usuario
  • Registrado: Dic 20, 2002
  • Mensajes: 8921
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Nota Junio 13th, 2011, 10:41 am

Me parece que la codificación de archivo es desordenada que puede causar el intérprete PHP a fallar. Cuando copia y pega el código directamente en nano para hacer una prueba rápida, consiguió el mismo error que usted, pero también observó como pasé mi cursor alrededor a lo largo de los caracteres extraños de archivo comienza a mostrar que es típico de codificaciones mal en archivos. Le recomendaría sería tratar y corregir la codificación del archivo, o completamente iniciar un nuevo archivo y volver a escribir todo lo que se ve sin copiar y pegar para que no pega cualquiera de los valores corruptos en.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Junio 14th, 2011, 12:04 pm

O simplemente utilizar notepad ++...le permite elegir su codificación.

PHP Código: [ Select ]
 
<?php
if(isset($_POST['email'])) {
     
    $email_to ="georanson@gmail-com";
    $email_subject = "Contact Form";
     
     
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    }
     
    // validation expected data exists
    if(!isset($_POST['first_name']) ||
        !isset($_POST['last_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['telephone']) ||
        !isset($_POST['comments'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');      
    }
     
    $first_name = $_POST['first_name']; // required
    $last_name = $_POST['last_name']; // required
    $email_from = $_POST['email']; // required
    $telephone = $_POST['telephone']; // not required
    $comments = $_POST['comments']; // required
     
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$first_name)) {
    $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  }
  if(!preg_match($string_exp,$last_name)) {
    $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  }
  if(strlen($comments) < 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  }
  if(strlen($error_message) > 0) {
    died($error_message);
  }
    $email_message = "Form details below.\n\n";
     
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }
     
    $email_message .= "First Name: ".clean_string($first_name)."\n";
    $email_message .= "Last Name: ".clean_string($last_name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Telephone: ".clean_string($telephone)."\n";
    $email_message .= "Comments: ".clean_string($comments)."\n";
     
 
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
 
<!-- include your own success html here -->
 
Thank you for contacting us. We will be in touch with you very soon.
 
<?php
}
?>
 
 
  1.  
  2. <?php
  3. if(isset($_POST['email'])) {
  4.      
  5.     $email_to ="georanson@gmail-com";
  6.     $email_subject = "Contact Form";
  7.      
  8.      
  9.     function died($error) {
  10.         // your error code can go here
  11.         echo "We are very sorry, but there were error(s) found with the form you submitted. ";
  12.         echo "These errors appear below.<br /><br />";
  13.         echo $error."<br /><br />";
  14.         echo "Please go back and fix these errors.<br /><br />";
  15.         die();
  16.     }
  17.      
  18.     // validation expected data exists
  19.     if(!isset($_POST['first_name']) ||
  20.         !isset($_POST['last_name']) ||
  21.         !isset($_POST['email']) ||
  22.         !isset($_POST['telephone']) ||
  23.         !isset($_POST['comments'])) {
  24.         died('We are sorry, but there appears to be a problem with the form you submitted.');      
  25.     }
  26.      
  27.     $first_name = $_POST['first_name']; // required
  28.     $last_name = $_POST['last_name']; // required
  29.     $email_from = $_POST['email']; // required
  30.     $telephone = $_POST['telephone']; // not required
  31.     $comments = $_POST['comments']; // required
  32.      
  33.     $error_message = "";
  34.     $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  35.   if(!preg_match($email_exp,$email_from)) {
  36.     $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  37.   }
  38.     $string_exp = "/^[A-Za-z .'-]+$/";
  39.   if(!preg_match($string_exp,$first_name)) {
  40.     $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  41.   }
  42.   if(!preg_match($string_exp,$last_name)) {
  43.     $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  44.   }
  45.   if(strlen($comments) < 2) {
  46.     $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  47.   }
  48.   if(strlen($error_message) > 0) {
  49.     died($error_message);
  50.   }
  51.     $email_message = "Form details below.\n\n";
  52.      
  53.     function clean_string($string) {
  54.       $bad = array("content-type","bcc:","to:","cc:","href");
  55.       return str_replace($bad,"",$string);
  56.     }
  57.      
  58.     $email_message .= "First Name: ".clean_string($first_name)."\n";
  59.     $email_message .= "Last Name: ".clean_string($last_name)."\n";
  60.     $email_message .= "Email: ".clean_string($email_from)."\n";
  61.     $email_message .= "Telephone: ".clean_string($telephone)."\n";
  62.     $email_message .= "Comments: ".clean_string($comments)."\n";
  63.      
  64.  
  65. $headers = 'From: '.$email_from."\r\n".
  66. 'Reply-To: '.$email_from."\r\n" .
  67. 'X-Mailer: PHP/' . phpversion();
  68. @mail($email_to, $email_subject, $email_message, $headers);
  69. ?>
  70.  
  71. <!-- include your own success html here -->
  72.  
  73. Thank you for contacting us. We will be in touch with you very soon.
  74.  
  75. <?php
  76. }
  77. ?>
  78.  
  79.  
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Publicar Información

  • Total de mensajes en este tema: 11 mensajes
  • Usuarios navegando por este Foro: demonmaestro y 127 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC