Compatibility issues PHP4 and PHP3 solution to an incompatibility problem

Source: Internet
Author: User
PHP4 and PHP3 some incompatible places, but this is mainly PHP4 in the php.ini
There are some differences in the settings, these changes are mainly to improve the efficiency of PHP4.
Among the changes, the Track_vars settings are usually made to make the old PHP3 program not
Run again because the value of Track_vars is set to off in the PHP4 extension setting
In this way, the old PHP3 program cannot be transferred directly from the page with Get,post,cookie.
Variable.
I have a simple workaround here, without having to set track_vars to ON,
But this is only a expedient way, after all, we still use $http_get_vars,
It is better to read these variables $HTTP _post_vars and $HTTP _cookie_vars.
Here is a simple program that everyone can add to each need to read Get,post,cookie
variables, you can refer to them directly before the page.
get.variable.inc.php
if (Isset ($HTTP _post_vars))
{
while (list ($key, $val) = each ($HTTP _post_vars))
{
$ $key = $val;
}
}
if (Isset ($HTTP _get_vars))
{
while (list ($key, $val) = each ($HTTP _get_vars))
{
$ $key = $val;
}
}
if (Isset ($HTTP _cookie_vars))
{
while (list ($key, $val) = each ($HTTP _cookie_vars))
{
$ $key = $val;
}
}
?>
Please give us a lot of advice!

The above describes a compatibility problem PHP4 and PHP3 a solution to the incompatibility problem, including compatibility issues, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.