variable chopped when using POST method, but not GET :?
Moderator: General Moderators
variable chopped when using POST method, but not GET :?
I am totally at lost with this one.
When I change from using GET to using POST, the last character of the value typed in the single variable in my form gets chopped off.
I dumped the $GLOBALS and $_POST arrays and they contain the same truncated value.
GET transmits it with no loss. Any idea?
Thank you!
When I change from using GET to using POST, the last character of the value typed in the single variable in my form gets chopped off.
I dumped the $GLOBALS and $_POST arrays and they contain the same truncated value.
GET transmits it with no loss. Any idea?
Thank you!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Continued
Thank you for moving it.
My code is very straight forward:
- a form with method="post"
- a field called Userid
- a submit button
When I read the value returned in my PHP script, it is truncated if post is used, not with get.
Something else is changed: if I type a < character in the field, it is left alone by get, but post changes it to %3 (truncation of %3C, the code for <). Strange hey?
I am using PHP 4.2.1 on W98.
My code is very straight forward:
- a form with method="post"
- a field called Userid
- a submit button
When I read the value returned in my PHP script, it is truncated if post is used, not with get.
Something else is changed: if I type a < character in the field, it is left alone by get, but post changes it to %3 (truncation of %3C, the code for <). Strange hey?
I am using PHP 4.2.1 on W98.
Here is the code, but I think you'll be disappointed:
HTML
PHP
changing the form's method means the _post and _get arrays' contents change. Except the _POST array contains a truncated $Userid variable.
This is probably something to do with PHP's (or apache's?) setup as I discovered even phpmyadmin is crippled and doesn't pass parameters right (database names get truncated).
Thanks again very much for your insight.
HTML
Code: Select all
<form action="{$PHP_SELF}" method="post">
<tr><td valign="top" >Login: </td>
<td><input name="Userid" id="Userid" maxlength="16" size="16">Code: Select all
while (list($name,$value) = each($_GET)) {echo "ggggggget $name=$value<br>\n";}
while (list($name,$value) = each($_POST)) {echo "ppppppp $name=$value<br>\n";}This is probably something to do with PHP's (or apache's?) setup as I discovered even phpmyadmin is crippled and doesn't pass parameters right (database names get truncated).
Thanks again very much for your insight.