Welcome Guest, Not a member yet? Register   Sign In
$_POST and PHP version
#1

[eluser]Lobosaurus[/eluser]
Hi, I am using something like this in my script:

Code:
foreach ($_POST as $key => $value)

OR

count($_POST);
...

I tried my script on two different servers: one with PHP4 and second with PHP5.

With PHP4 everythinkg runs correctly, but the same script with PHP5 writes error:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: _POST

Filename: libraries/Profiler.php

Line Number: 153

... although script works with submited $_POST values.

There are more differences: PHP4 version shows posted data in Benchmark but PHP5 version shows that no POST data are available. Strange.
#2

[eluser]Lobosaurus[/eluser]
I realized that this error is caused by:

Code:
unset($_POST);

at the end of the script.
#3

[eluser]Grahack[/eluser]
And why php4 and php5 behave diferently?
Quite strange...




Theme © iAndrew 2016 - Forum software by © MyBB