Foros del Web » Programando para Internet » PHP »

Error en Php del Contactar LIGHFORM Ayuda!

Estas en el tema de Error en Php del Contactar LIGHFORM Ayuda! en el foro de PHP en Foros del Web. Hola bueno me encontre este minisistema .. de CONTACTAR con un Diseño vistoso.. ahora.. no entiendo porke me sale error..! ... Si solo me pidieron ...
  #1 (permalink)  
Antiguo 17/04/2009, 22:31
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Error en Php del Contactar LIGHFORM Ayuda!

Hola bueno me encontre este minisistema .. de CONTACTAR con un Diseño vistoso.. ahora.. no entiendo porke me sale error..! ... Si solo me pidieron el correo.. A DONDE LLEGARA.. ALGUIEN SABE como poder Solucionarlo :

Cita:
PHP Notice: Undefined index: name in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 59 PHP Notice: Undefined index: email in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 60 PHP Notice: Undefined index: website in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 61 PHP Notice: Undefined index: subject in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 65 PHP Notice: Undefined index: message in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 75 PHP Notice: Undefined index: HTTP_REFERER in E:\Domains\tryalsoft.com\wwwroot\LightForm\index.p hp on line 83
No Entiendo porque ese Error.. Por favor.. !
  #2 (permalink)  
Antiguo 18/04/2009, 11:12
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Sin ver el codigo es practicamente imposible saberlo, solo puedo imaginar que los datos que el formulario espera recibir no aparecen en la matriz donde los busca: $_POST, $_GET, $_SESSION, etc.
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 18/04/2009, 11:34
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Entiendo.. pero .. el codigo lo Pongo Aora

Código PHP:
<?php


$to 
'[email protected]';

$ebits ini_get('error_reporting');
error_reporting($ebits E_NOTICE);
//User info (DO NOT EDIT!)
$name stripslashes($_POST['name']); //sender's name
$email stripslashes($_POST['email']); //sender's email
$website stripslashes($_POST['website']); //sender's website

//The subject
$subject  "[Pregunta Sobre TryalCine] "//The default subject. Will appear by default in all messages. Change this if you want.
$subject .= stripslashes($_POST['subject']); // the subject



$msg  "From : $name \r\n";  //add sender's name to the message
$msg .= "e-Mail : $email \r\n";  //add sender's email to the message
$msg .= "Website : $website \r\n"//add sender's website to the message
$msg .= "Subject : $subject \r\n\n"//add subject to the message (optional! It will be displayed in the header anyway)
$msg .= "---Message--- \r\n".stripslashes($_POST['message'])."\r\n\n";  //the message itself

$msg .= "---User information--- \r\n"//Title
$msg .= "User IP : ".$_SERVER["REMOTE_ADDR"]."\r\n"//Sender's IP
$msg .= "Browser info : ".$_SERVER["HTTP_USER_AGENT"]."\r\n"//User agent
$msg .= "User come from : ".$_SERVER["HTTP_REFERER"]; //Referrer


?>
  #4 (permalink)  
Antiguo 18/04/2009, 12:20
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Bueno, habria que ver ahora el formulario HTML, verificar que tenga definido el metodo post y existan los campos con los nombres adecuados.
__________________
- León, Guanajuato
- GV-Foto
  #5 (permalink)  
Antiguo 18/04/2009, 13:54
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Bueno este es el FORM: Y si parece que esta... declarado el METOD POST

Código PHP:
<?php
   
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      
$self $_SERVER['PHP_SELF'];
?>

    <!-- Start HTML form -->
       <form name="form" method="post" id="third" action="<?php echo $self;?>">
        <h1>:::LightForm::: Free Ajax/PHP Contact Form</h1>

        <!-- Name -->
        <label for="name"><strong><span class="blue">*</span> Name : </strong></label>
            <input id="name" name="name" type="text" class="validate['required','length[3,-1]','nodigit'] textinput" />

        <!-- Email -->
        <label for="email"><strong><span class="blue">*</span> Email : </strong></label>
            <input id="email" name="email" type="text" class="validate['required','length[5,-1]','email'] textinput" />

        <!-- Website -->
        <label for="site">Website : </label>
            <input id="website" name="website" type="text" class="validate['url'] textinput" />

        <!-- Subject -->
        <label for="subject"><strong><span class="blue">*</span> Subject : </strong></label>
            <input id="subject" name="subject" type="text" class="validate['required'] textinput" />

        <!-- Message -->
        <label for="msg"><strong><span class="blue">*</span> Your message : </strong></label>
            <textarea id="message" name="message" type="text" class="validate['required'] textarea"></textarea>

        <!-- Spam Check -->
        <label for="spamcheck"><span class="blue">*</span> <acronym  title="[ Spam prevention ]"><strong>Are you human?</acronym> : <span class="blue">2 + 3 = ???</span></strong></label>
            <input id="spamcheck" name="spamcheck" type="text" size="5" class="validate['required','number','spamcheck'] textinput_small" />

        <br /><br />
        <input type="submit" class="buttonSubmit" value="Send it!" />

        <!-- Niceforms: mouse over effect -->
        <!-- Do not remove the line below -->
        <div id="stylesheetTest"></div>
    </form>
  #6 (permalink)  
Antiguo 18/04/2009, 14:25
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Todo el bloque de asignacion de valores esta mal ubicado, o bien, habria que ponerlo asi:

Código PHP:
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    
//User info (DO NOT EDIT!)
    
$name stripslashes($_POST['name']); //sender's name
    
$email stripslashes($_POST['email']); //sender's email
    
$website stripslashes($_POST['website']); //sender's website

    //The subject
    
$subject  "[Pregunta Sobre TryalCine] "//The default subject. Will appear     by default in all messages. Change this if you want.
    
$subject .= stripslashes($_POST['subject']); // the subject

    
$msg  "From : $name \r\n";  //add sender's name to the message
    
$msg .= "e-Mail : $email \r\n";  //add sender's email to the message
    
$msg .= "Website : $website \r\n"//add sender's website to the message
    
$msg .= "Subject : $subject \r\n\n"//add subject to the message (optional! It will be displayed in the header anyway)
    
$msg .= "---Message--- \r\n".stripslashes($_POST['message'])."\r\n\n";  //the message itself

    
$msg .= "---User information--- \r\n"//Title
    
$msg .= "User IP : ".$_SERVER["REMOTE_ADDR"]."\r\n"//Sender's IP
    
$msg .= "Browser info : ".$_SERVER["HTTP_USER_AGENT"]."\r\n"//User agent
    
$msg .= "User come from : ".$_SERVER["HTTP_REFERER"]; //Referrer

Asi, solo se realizara la asignacion cuando se haya enviado el formulario.
__________________
- León, Guanajuato
- GV-Foto
  #7 (permalink)  
Antiguo 18/04/2009, 15:12
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Era cuestion de Orden Ummm.. espero ke funcione voy a probarlo gracias Amigo.. ! :) Como siempre el Mejor Foro Para Lenguajes de Programacion WEb :) Saludos y de Nuevo Muxaz Gracias Sea Cual Sea EL Resultado :)

Pues Nada volvi a Probar y Me Salio Este Error el Mismo sobre laz variables oye pero OJO... EL FORM Y EL CODE ESTAN EN EL MISMO... PHP .. EN ESTE CASO ES index.php AHI ESTAN TOO EL CODIGO PHP Y EL FORM...: ESTE ERROR ME SALIO DE NUEVO :

Cita:
Notice: Undefined index: name in C:\AppServ\www\LightForm\index.php on line 65

Notice: Undefined index: email in C:\AppServ\www\LightForm\index.php on line 66

Notice: Undefined index: website in C:\AppServ\www\LightForm\index.php on line 67

Notice: Undefined index: subject in C:\AppServ\www\LightForm\index.php on line 71

Notice: Undefined index: message in C:\AppServ\www\LightForm\index.php on line 81

Notice: Undefined index: HTTP_REFERER in C:\AppServ\www\LightForm\index.php on line 89
Mira El Error Que Me Sale Aki esta es la direccion que sib en mi SERVIDOR DE WINDOWS.. O HOSTING WINDOWS.. DE PAGA :

tryalsoft.com/contactar

si llenas los datos veras que error manda y a pesar de eso... viendo el codigo fuente.. sale el nombre que llene..!

Última edición por GatorV; 18/04/2009 a las 15:28
  #8 (permalink)  
Antiguo 18/04/2009, 16:25
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Sorry, fue un error mio, en lugar de != en la comparacion debe ser ==
__________________
- León, Guanajuato
- GV-Foto
  #9 (permalink)  
Antiguo 18/04/2009, 17:51
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Pero ese nu le hace diferente.. porke al igualarlo..! No creo ... no manda nada porke aunke se nu envia el mensaje de satisfactorio :( !... nu se que pasa.. taz zeguro que es asi.. !

mira ahora nu hace nada.. :

tryalsoft.com/contactar/index.php
  #10 (permalink)  
Antiguo 18/04/2009, 17:59
Avatar de Ronruby  
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Pero, ¿el correo se envía? ¿Que versión de PHP tienes?

Lo que te estan diciendo esos mensajes de error es que las variables que estas tratando de usar no estan definidas.

Tienes que hacer:

if(isset($_POST)) {
//Todo tu codigo aqui para evitar esos mensajes de error
}
  #11 (permalink)  
Antiguo 20/04/2009, 13:04
 
Fecha de Ingreso: noviembre-2008
Mensajes: 150
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Error en Php del Contactar LIGHFORM Ayuda!

Como Azi?.. hacert un IF? .. para preguintar si .. envio .. el POST?.. NU ENTIENDO .. VISTE EL C0ODIGO MAZ ARRIBA KE PUSE EN KE ZONA CREES QUE DEBERIA PONER .. EL IF QUE ME INDICAS :)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:23.