PHP prohibits direct access to the problem

Source: Internet
Author: User
I have two files, a file is loaded by B file, I used to define constants in B file, and then verify in a file whether there is this constant, but the validation is invalid.
The code is as follows:
A file:


  
   

b文件:


求助如何解决?

Reply content:

I have two files, a file is loaded by B file, I use the B file to define the constants, and then in a file to verify whether there is this constant, but the validation is invalid. The
code is as follows:
A file:

 !--? phpif (!defined (Heidomain)) {exit ("123");}   

B File:

!--? phpdefine (' Heidomain ', True); require '/include /makeuser.php ';? -->
Help How to solve?

a.php

  php  !--? phpif (!defined (' Heidomain ')} {exit (" 123 ");   

quotation marks, or detection True Whether this value is defined.

Reference:
http://php.net/manual/en/function.defined.php

To require the B file in a file

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