php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15433 sending parameters from html form to a php script
Submitted: 2002-02-07 14:17 UTC Modified: 2002-02-21 16:27 UTC
From: netmics at hotmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.1.1 OS: windows 2000 Professional
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: netmics at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-02-07 14:17 UTC] netmics at hotmail dot com
I have php(cgi only) on IIS 5 and I have problems to send information from an html form to a php page to process this data. The problem is that sometimes the php page doesn't catch all the variables from the html form page (in this case the value of the submit button named "aceptar"). The files are the following:

-HTML from

<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM METHOD="get" ACTION="buscadorPhp.php">
palabra clave:<INPUT TYPE="text" name="T1"><BR>
<INPUT TYPE="submit" NAME="buscar" VALUE="search">
</FORM>
</BODY>
</HTML>

-PHP data processor

<HTML>
<HEAD>
</HEAD>
<BODY>
<?php
if(!isset($buscar))
	{
	echo "debe especificar la cadena a buscar";
	echo "</body></html>";
	exit;
	}

$link=mysql_connect("localhost","nobody");
mysql_select_db("mybd",$link);
$result=mysql_query("select * from agenda where nombre like '%$T1%' order by nombre",$link);

	if($row=mysql_fetch_array($result))
		{
		echo "<table border=1><tr>";
		while($field=mysql_fetch_field($result))
			{
			echo "<td>$field->table</td> \n";
			}
			echo "</tr>";
		do
			{
			echo "<tr><td>".$row["id"]."</td><td>".$row["nombre"]."</td><td>".$row["direccion"]."</td><td>".$row["email"]."</td></tr> \n";
			}while($row=mysql_fetch_array($result));
		echo "</table>";
		}else echo "no se encontraron registros"
?>
</BODY>
</HTML>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-19 15:53 UTC] cmk@php.net
Please provide more information.

What is your setting of register_globals?
And how do you experience this error? Is isset($buscar) always false?
 [2002-02-21 15:59 UTC] netmics at hotmail dot com
my setting of register globals is On.
I press the "buscar" button and the value "search" is set in this variable. This variable is analized by the isset function in this way: if(!isset($buscar)). This means that if the variable $buscar is not set in the html form, the program jumps to the other group of instructions.
The problem is when the variables are passed from the html form to the php processor page, the php page doesn?t catch the variable "buscar", we can see it in the url of the browser:

buscadorPhp.php?T1=carlos
and it should be
buscadorPhp.php?T1=carlos&buscar=search
 [2002-02-21 16:06 UTC] derick@php.net
If it does not show up in the browser bar, then it's your browser who is doing weird things.
I can remember a situation myself that if you pressed enter to submit the form (instead of clicking the button) IE didn' send over the button's variable.

As this is not a PHP issue, I'm marking this bug as 'bogus'.

regards,
Derick
 [2002-02-21 16:27 UTC] netmics at hotmail dot com
you are right Derick, to avoid this problem, i'll test it with a hidden variable in the html form, or you have another idea or advise?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 23:01:29 2024 UTC