Solution to an incompatible problem between PHP4 and PHP3

Source: Internet
Author: User

PHP4 is incompatible with PHP3, but it is mainly caused by PHP. ini in PHP4.
There are some differences in the settings. These changes mainly improve the efficiency of PHP4.
In the changes, the track_vars settings usually make the old PHP3 program unavailable.
Run again, because the track_vars value is set to off in the PHP4 extension settings.
In this way, the GET, POST, and COOKIE cannot be directly transmitted from the previous page in the old PHP3 program.
.

I have a simple solution here. You don't need to set track_vars to on,
However, this is only an appropriate method. In the future, we will use $ HTTP_GET_VARS,
$ HTTP_POST_VARS and $ HTTP_COOKIE_VARS read these variables better.

The following is a simple program. You can add GET, POST, COOKIE
You can directly reference these variables.

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 kindly advise!

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.