php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19379 When sending a form to a php script, the variables are not available
Submitted: 2002-09-12 14:08 UTC Modified: 2002-09-12 14:10 UTC
From: juaconesaarias at terra dot es Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.2 OS: Windows 98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: juaconesaarias at terra dot es
New email:
PHP Version: OS:

 

 [2002-09-12 14:08 UTC] juaconesaarias at terra dot 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. 

:)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-12 14:10 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 08:01:33 2024 UTC