Connecting Tech Pros Worldwide Forums | Help | Site Map

strange POST vs GET behaviour

flits@flats.nl
Guest
 
Posts: n/a
#1: Dec 27 '06
LS

I have set up my first Linux box. But I experience some strange POST
behaviour. Maybe this is a know bug or maybe I have done something
wrong with my setup. But I just can't seem to find any solution about
it on google.

I have the following two scripts:

1.php:

<form name="input" action="2.php" method="post">
to pass: <input type="text" name="pass">
<input type="submit" value="Submit">
</form>

2.php:

<?php

echo "passed: ".$_POST['pass'];

echo "<pre>";
print_r($_REQUEST);
echo "</pre>";

?>

This results in:

Notice: Undefined index: pass in /var/www/2.php on line 3
passed:

Array
(
)

The above script doesn't pass the POST. But when I change it to GET it
does get passed to 2.php. Does anyone have an idea?

I am using:

Debian 3.1r4
Apache v1.3.33
PHP v4.3.10-18

Kind regards,
Flits.

Janwillem Borleffs
Guest
 
Posts: n/a
#2: Dec 28 '06

re: strange POST vs GET behaviour


flits@flats.nl wrote:
Quote:
This results in:
>
Notice: Undefined index: pass in /var/www/2.php on line 3
passed:
>
Array
(
)
>
The above script doesn't pass the POST. But when I change it to GET it
does get passed to 2.php. Does anyone have an idea?
>
Check the output of phpinfo() to see if it gets anywhere. Also, check the
output of both $HTTP_POST_VARS and $_REQUEST['HTTP_POST_VARS'].

Perhaps you upgraded from a pre-4.2 version and some old bits and pieces
where left. You can also try to rename the php.ini file to php.ini.old and
restart your webserver. After this, PHP should resort to its defaults as it
will not be able to locate the php.ini file.


JW


lawrence k
Guest
 
Posts: n/a
#3: Dec 28 '06

re: strange POST vs GET behaviour



flits@flats.nl wrote:
Quote:
The above script doesn't pass the POST. But when I change it to GET it
does get passed to 2.php. Does anyone have an idea?
>
I am using:
>
Debian 3.1r4
Apache v1.3.33
PHP v4.3.10-18
Check php.ini for anything to do with POST.

Closed Thread