#20823 [Opn]: form post results in duplicitous $_REQUEST
| From: | moriyoshi@php.net | Date: | Fri, 06 Dec 2002 17:29:07 +0000 |
| Subject: | #20823 [Opn]: form post results in duplicitous $_REQUEST | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26866@lists.php.net to get a copy of this message | ||
ID: 20823
Updated by: moriyoshi@php.net
Reported By: buckley@menacefx.com
Status: Open
Bug Type: Apache2 related
Operating System: Redhat7.2
PHP Version: 4.3.0RC2
New Comment:
Oops, I should have meant php_strtok_r() replaces the delimiter "=" by
"\0".
Previous Comments:
------------------------------------------------------------------------
[2002-12-05 12:59:27] buckley@menacefx.com
MoriYoshi, I read #18648. Yes, this looks like the same problem. Seems
everyone having this is running Apache2 (as I am).
I put a hidden element in the form so that more than one value was
submitted in the POST and *_the_problem_goes_away_*.
Sniper, here are some short files which trigger the problem.
forSniper.html ::
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>something short for sniper@php.net - part 1</title>
</head>
<body>
<form action="forSniperResult.php" method="POST"><input
type="text"
name="recipient" value="sniper"><input
type="submit"></form>
</body>
</html>
forSniperResult.php ::
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>something short for sniper@php.net - part 2</title>
</head>
<body>
who = <?php echo $_REQUEST["recipient"]; ?>
</body>
</html>
result ::
who = sniperrecipient=sniper
------------------------------------------------------------------------
[2002-12-05 10:00:47] sniper@php.net
We need a _SHORT_ example script which does not have any external
requirements, such as mysql..
------------------------------------------------------------------------
[2002-12-05 03:56:31] moriyoshi@php.net
Duplication of #18648?
http://bugs.php.net/18648
------------------------------------------------------------------------
[2002-12-04 23:02:58] buckley@menacefx.com
<?php var_dump($_REQUEST); ?> :
array(3) { ["staffId"]=> string(10) "3staffId=3"
["trackerUser"]=>
string(5) "staff" ["trackerPasswd"]=> string(5) "staff" }
script: staffForm.php :
<?php include("header.inc"); ?>
<title>staff form</title>
</head>
<body>
<?php
if ( !isset($_REQUEST['staffId']) || $_REQUEST['staffId']==0 ) {
return;
}
$staffId = substr($_REQUEST["staffId"], 1);
// printf("<p>%s-%s</p>\n", $p_staffId, $_REQUEST["staffId"]);
$query = "SELECT * FROM staff WHERE $staffId";
$result =& doQ($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC) ;
$login = $row["login"];
$name = $row["firstName"] . " " . $row["lastName"];
$title = $row["title"];
//mysql_free_result($result);
?>
<table cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="section">name</td>
<td class="data"><?php echo $name; ?></td>
</tr>
<tr>
<td class="section">title</td>
<td class="data"><?php echo $title; ?></td>
</tr>
<tr>
<td class="section">login</td>
<td class="data"><?php echo $login; ?></td>
</tr>
<tr>
<td class="section"><a href="modifyDuties.php?staffId=<?php echo
$_REQUEST["staffId"]; ?>">duties</a></td>
<td class="data">
<form action="modifyDuties.php?staffId=<?php echo $staffId; ?>"
method="GET" name="staffForm">
<?php
$result =& doQ("SELECT * FROM skill ");
$result2 =& doQ("SELECT * FROM staffSkill WHERE $staffId ");
$skills = array();
while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC) ) {
$skills[] = $row2["skillId"];
}
if ( count($skills) ) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC) ) {
if ( array_search( $row["skillId"], $skills) > -1 ) {
print $row["skillName"]."<br>";
}
}
} else {
print "No duties specified.";
}
/* Free resultset */
//mysql_free_result($result);
//mysql_free_result($result2);
?>
<!-- <a href="modifyDuties.php?staffId=<?php echo $staffId; ?>"><span
class="modifyButton">modify</span></a></td> -->
</tr>
</table>
<?php var_dump($_REQUEST); ?>
</body>
<?php
/* Closing connection */
mysql_close($link);
?>
</html>
------------------------------------------------------------------------
[2002-12-04 22:46:51] sniper@php.net
What does 'var_dump($_REQUEST)' output?
And can you please add a short but _complete_ example script here?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/20823
--
Edit this bug report at http://bugs.php.net/?id=20823&edit=1