Page 1 of 1

Form code not working

Posted: Sun Sep 26, 2004 5:41 pm
by maƱungo
feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


The following form code is actually working but it give an error:

Code: Select all

<?php
if(isset($nombre)) {
$mensaje=":: Mensaje desde Web H.Ecuestre.cl :: " . chr(13). chr(10);
$mensaje=$mensaje . "nombre			:           " . $nombre        . chr(13). chr(10);
$mensaje=$mensaje . "email	    	:           " . $email         . chr(13). chr(10);
$mensaje=$mensaje . "consulta		:           " . $consulta      . chr(13). chr(10);


        $resultado = mail ("xxxxxxx@xxxxxxxxx.cl", "Contactado por: " . $nombre, $mensaje, $nombre);
 		if ($resultado) {
                include('http://www.xxxxxxxx.cl/gracias.htm'); }
                else {
                include('http://www.xxxxxxxxx.cl/campovacio.htm'); }
        }
?>

The error it gives is:

Code: Select all

Notice: Undefined variable: consulta in D:\Dominios\resadmin\haciendaecuestre\haciendaecuestre.cl\www\enviar.php on line 6
The problem in this thing is the error given, but the message is sent anyway, but the "consulta" does not appear in the result.

Please help.


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sun Sep 26, 2004 6:18 pm
by feyd
First off, wrong forum. Thread moved to the correct location: PHP - Code

consulta appears in what result? a database query? .. you need to access the variable correctly in those rules using their fetch function and array indices (generally.)