PhpUndefinedvariable and Undefinedindex_PHP tutorial-php Tutorial

Source: Internet
Author: User
PhpUndefinedvariable and Undefinedindex. In the php Tutorial undefinedvariable and undefinedindex, this problem occurs because the variable is undefined. we just need to add a verification such as $ aisset ($ _ get [aa])? $ _ Get [aa]: the variable is undefined. in this case, the undefined variable and undefined indexes of the php Tutorial are not performed.

If this problem occurs, the variable is undefined. we only need to add a verification code, as shown in figure

$ A = isset ($ _ get ['A'])? $ _ Get ['A']: 'variable undefined ';

In this way, undefined variable and undefined index are not displayed for undefined variables.
Yes. at the same time, we also provide methods for setting errors and not prompting in php ini or php.


Solution:
1) error_reporting settings:
Locate error_reporting = e_all
Change to error_reporting = e_all &~ E_notice

2) register_globals settings:
Find register_globals = off
Change to register_globals = on

When undefined variable and undefined index occur, the variable is undefined. we just need to add a verification code such as $ a = isset ($ _ get ['AA'])? $ _ Get ['A']: 'variable undefined '; so that no...

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.