Notes for upgrading PHP from 4.0.6 to 4.2.1

Source: Internet
Author: User

I used to develop a PHP program for a shopping website, but not long ago I upgraded PHP from 4.0.6 to 4.2.0, and then I ran it again ..... :) but the final problem is solved. Some people have encountered the same problem recently, so I just want to write it out. The main problem I encountered was that after the PHP. INI configuration parameter register_globals = off was set to off, the PHP program would not automatically start from the Cookie, Session and page address "? "The value of the variable is obtained in the parameter after the sign, and the value passed in the form is not automatically received. The reason for this is to prevent variable poisoning oning by default ), PHP versions earlier than the default one is off, so there is no problem. Solution: echo $ HTTP_COOKIE_VARS [variable]; // obtain the cookie value echo $ HTTP_SESSION_VARS [variable]; // obtain the session value echo $ HTTP_POST_VARS [variable]; // obtain the value passed by the form ----- the corresponding form Box Name echo $ HTTP_GET_VARS [variable]; // get "xxx. php? Variable = 123456 "echo $ HTTP_SERVER_VARS [REMOTE_ADDR]; // obtain the target IP address echo $ HTTP_POST_FILES []; // get the file passed through the form?> I hope you will try your best to write the code in the above way in the future (it will be costly to change the code after an error occurs ), the preceding method does not cause errors when register_globals is set to on or off, and is more secure.

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.