|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-12 14:10 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
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. :)