CodeIgniter Forums
$_POST and PHP version - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $_POST and PHP version (/showthread.php?tid=5630)



$_POST and PHP version - El Forum - 01-29-2008

[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.


$_POST and PHP version - El Forum - 01-29-2008

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

Code:
unset($_POST);

at the end of the script.


$_POST and PHP version - El Forum - 01-30-2008

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