#19379 [Opn->Bgs]: When sending a form to a php script, the variables are not available

From: Date: Thu, 12 Sep 2002 19:10:14 +0000
Subject: #19379 [Opn->Bgs]: When sending a form to a php script, the variables are not available
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19258@lists.php.net to get a copy of this message
ID: 19379 Updated by: derick@php.net Reported By: juaconesaarias@terra.es -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows 98 PHP Version: 4.2.2 New Comment: In PHP 4.2.0, the 'register_globals' setting default changed to 'off'. See http://www.php.net/release_4_2_0.php for more info. We are sorry about the inconvenience, but this change was a necessary part of our efforts to make PHP scripting more secure and portable. Previous Comments: ------------------------------------------------------------------------ [2002-09-12 14:08:57] juaconesaarias@terra.es When sending a form to a pphp script, the variables are not available on the script. For example: HTML FORM: <? include("libreriaphp.php"); encabezado_html("Introducir datos"); ?> <h2>Por favor, escribe tu aportación</H2> <form action="escribirbd.php" method="get"> Nombre: <input type="text" name="nombre" size=30><br> Apellido: <input type="text" name="apellido" size=30><br> Tu aportación:<br> <textarea name="texto" cols=40 rows=10></textarea><br> <input type="submit" value="Enviar contribución"> </form> <? pie_html(); ?> PHP SCRIPT CALLED BY FORM: <? include("libreriaphp.php"); conectar_bd("localhost","root","","prueba"); echo "variable f_texto: "; $texto; echo "<BR>"; echo "variable f_aut_nombre: "; $nombre; echo "<BR>"; echo "variable f_aut_apellido: "; $apellido; echo "<BR>"; if (($texto != "") && ($nombre != "") && ($apellido != "")) { $insertar_texto = "INSERT INTO aportaciones(nombre, apellido, texto) VALUES(\"$f_aut_nombre\", \"$f_aut_apellido\", \"$f_texto\")"; mysql_query($insertar_exto); echo mysql_error(); echo "Muchas gracias por tu aportación <BR>"; $introducir_aport="Introduce tu aportación"; } else { echo "ERROR: No has rellenado todos los campos. <BR>"; $introducir_aport = "Vuelve a introducir tu aportación"; } echo "<A HREF=form_entrada.php>$introducir_aport</A><BR>"; echo "<A HREF=leerbd.php>Leer aportaciones</A>" ?> In this case, the variables are not available for the PHP script, althought thay have been send by form. The result is that the script does nothing Can it be a problem in the .ini file or something like it? Thank you. :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19379&edit=1

« previous php.bugs (#19258) next »