Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/05/2009, 15:08
w00t007
 
Fecha de Ingreso: julio-2008
Mensajes: 20
Antigüedad: 15 años, 9 meses
Puntos: 0
Exclamación Respuesta: Sencillo pero triste unexpected T_VARIABLE

Estimado ahora sale otro error y revise el codigo pero ahora es una else

Parse error: syntax error, unexpected T_ELSE in /htdocs/public/contacto/scripts/contact.php on line 198

publico la linea 198 a 203:

Código PHP:
     } else {
     if ( 
$_GET['xml'] == true ) {
            
$status '<li class="errMsg">Error! Ha ocurrido algun error al enviar su correo.</li>';
            echo 
'
                <ul id="status">
        '
.$status.'
                </ul>'

Y tambien el codigo completo revise todo lo mismo sigue.

Código PHP:
<?php
include('config.php');

if (isset(
$_POST['posted'])) {
    
session_start();
    global 
$HTTP_HOST;
    
$f_r getenv("HTTP_REFERER");
    if (
$f_r != "") {
        
$f_x 0;
            
$f_y 0;
        while(
$f_x sizeof($ref)) {
                if(
strstr($f_r,$ref[$f_x])) {
            
$f_y "1";
            }
        
$f_x++;
    }
    if(!
$f_y) {
        
$error true;
        
$fail[0] = 'Intentas utilizar el formulario desde un dominio no permitido';
    } else {
        if(
eregi("MIME-Version:",$_POST['nombre'].$_POST['apellido'].$_POST['email'].$_POST['ciudad'].$_POST['pais'].$_POST['telefono'].$_POST['msn']) || eregi("Content-Type:",$_POST['nombre'].$_POST['apellido'].$_POST['email'].$_POST['ciudad'].$_POST['pais'].$_POST['telefono'].$_POST['msn'])) {
        
$error true;
        
$fail[0] = 'Humm, porque no vas a jugar a otra parte!!';
        } else { 
        if (empty(
$nombre)) {
            
$error true;
            
$fail[1] = 'Campo obligatorio.';
        }
        if (empty(
$apellido)) {
            
$error true;
            
$merr[0] = 'Campo obligatorio.';
        }
        if (empty(
$email)) {
            
$error true;
            
$fail[2] = 'Campo obligatorio.';
        }
        if (empty(
$ciudad)) {
            
$error true;
            
$fail[2] = 'Campo obligatorio.';
        }
        if (empty(
$pais)) {
            
$error true;
            
$fail[2] = 'Campo obligatorio.';
        }
        if (empty(
$telefono)) {
            
$error true;
            
$fail[2] = 'Campo obligatorio.';
        }
        if (empty(
$msn)) {
            
$error true;
            
$fail[2] = 'Campo obligatorio.';
        }
        if (!
$error) {
        if(isset(
$_POST['email'])) {
        if (!
eregi($regexp$email)) {
        
$error true;
        
$merr[1] = 'La direccion de correo no esta escrita con el formato adecuado.';
    } else {
        list ( 
$username$domain ) = split ("@",$email);
        if (
getmxrr($Domain$MXHost))  {
        
$ConnectAddress $MXHost[0];
        } else {
        
$ConnectAddress $domain;
        }
        
$Connect fsockopen $ConnectAddress25 );
        if (
$Connect) {
        if (
ereg("^220"$Out fgets($Connect1024))) {
            
fputs ($Connect"HELO $HTTP_HOST\r\n");
            
$Out fgets $Connect1024 );
            
fputs ($Connect"MAIL FROM: <{$email}>\r\n");
            
$From fgets $Connect1024 );
            
fputs ($Connect"RCPT TO: <{$email}>\r\n");
            
$To fgets ($Connect1024);
            
fputs ($Connect"QUIT\r\n");
            
fclose($Connect);
                if (!
ereg ("^250"$From) || !ereg "^250"$To )) {
                
$error true;
                        
$merr[2]= 'El servidor no acepta la direccion';
                    }
        } else {
           
$error true;
           
$merr[2] = 'No se ha obtenido respuesta del servidor';
                }
            }  else {
            
$error true;
        
$merr[2] = 'No se puede conectar con el servidor de correo';
         }
     if (!
$error) {
    
$to $yourName;
    
$subject $yourSubject.': '.stripslashes($sub);
    
$date date("d-M-y H:i");
    
$boundary md5(time().rand(1,100));
    
$headers "From:$email\nReply-To:$email\n";
    
$headers .= "X-Mailer:PHP/".phpversion()."\n";
    
$headers .= "Mime-Version: 1.0\n";
    
$headers .= "Content-Type: multipart/alternative; boundary=\"{$boundary}\"\n";
    
$message "
--{$boundary}
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Felicidades $yourName !!\n
Se ha Registrado un Nuevo Prospecto en tu Robot desde tu Web personal\n

Datos del Nuevo Prospecto añadido a tu Lista de Prospectos\n
Activos o Clientes Interesados:\n

-----------------------------------------------------------\n
Nombre: $nombre\n
Apellido: $apellido\n
E-Mail: $email\n
Ciudad: $ciudad\n
Pais: $pais\n
Telefono: $telefono\n
MSN o Skype: $msn\n
Correo enviado el $date\n
------------------------------------------------------------\n
Muchas Felicidades $yourName !!\n

Sigue asi, vas por el camino correcto para lograr tus Sueños !!\n

Muchas gracias por confiar en mis servicios y te deseo muchos nuevos exitos.\n

Tu Robot FFI\n

--{$boundary}--

"
;
    
$message strip_tags(stripslashes($message));
    
$mailit mail($yourEmail$subject$message$headers);
    
    if (isset(
$_POST['selfcopy'])) {
    
$ccemail stripslashes($email);
        
$message2 "
--{$boundary}
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Esta es una copia del email enviado en $date\n
____________________________________________\n
-----------------------------------------------------------\n
Nombre: $nombre\n
Apellido: $apellido\n
E-Mail: $email\n
Ciudad: $ciudad\n
Pais: $pais\n
Telefono: $telefono\n
MSN o Skype: $msn\n
Correo enviado el $date\n
------------------------------------------------------------\n

--{$boundary}--

"
;
        
$headers2 "From: $yourEmail\nReply-To: $yourEmail\n";
    
$headers2 .= "X-Mailer:PHP/".phpversion()."\n";
        
$headers2 .= "Mime-Version: 1.0\n";
        
$headers2 .= "Content-Type: multipart/alternative; boundary=\"{$boundary}\"\n";
        
$sub2 "Re: $subject\n";
        
$message2 strip_tags(stripslashes($message2));
        
mail($ccemail$sub2$message2$headers2);
    }
    }
    }
}
}
    if ( 
$_GET['xml'] == true ) {
    if (!
$error) {
            
$status '<li class="scsMsg">OK! Su correo se ha procesado correctamente. <br /> Gracias por su interes.</li>';
    } else {
            
$status '<li class="errMsg">Error! Ha ocurrido algun error al enviar su correo. <br />Por Favor revise los datos del formulario y vuelva a intentarlo.</li>';
        foreach (
$merr as $key => $value){
            
$merr '<li class="errMsg">'.$value.'</li>';
        }
    }
        echo 
'
                <ul id="status">
            '
.$status.'
            '
.$merr.'
                </ul>'
;
    } else {
    if (!
$error) {
        
$_SESSION["success"] = true;
        
header('Location: '.$referringPage.'');
        exit();
    } else {
        
$_SESSION["error"] = true;
        
$_SESSION["nombre"] = $nombre;
        
$_SESSION["apellido"] = $apellido;
        
$_SESSION["email"] = $email;
        
$_SESSION["ciudad"] = $ciudad;
        
$_SESSION["pais"] = $ciudad;
        
$_SESSION["telefono"] = $telefono;
        
$_SESSION["msn"] = $msn;
        
$_SESSION["fail"] = $fail;
        
$_SESSION["merr"] = $merr;
        
header('Location: '.$referringPage.'');
        exit();
     } else {
     if ( 
$_GET['xml'] == true ) {
            
$status '<li class="errMsg">Error! Ha ocurrido algun error al enviar su correo.</li>';
            echo 
'
                <ul id="status">
        '
.$status.'
                </ul>'
;
    } else {
        
$_SESSION["error"] = true;
        
header('Location: '.$referringPage.'');
        exit();
    }
}
?>