How to use the include encryption path in php

Source: Internet
Author: User
How to use the include encryption path in php

  1. Include_once 'include/Base. php ';
  2. $ Path = '';
  3. $ Url = isBase: decrypt (urlDecode ($ _ SERVER ['query _ string']);
  4. Parse_str ($ url); // GET the variable passed through the url address GET
  5. If (! Empty ($ _ POST ['path']) {// Get the variable passed by POST
  6. $ Path = $ _ POST ['path'];
  7. $ Path = isBase: decrypt (urlDecode ($ path ));
  8. }
  9. // Parse the actual path
  10. If (empty ($ path )){
  11. // Header ("Location: login. php ");
  12. Exit;
  13. }
  14. If (! Preg_match ("/(^ http: \/) | ([? | & | =])/", $ Path )){
  15. // Jump to the path of the actual execution file
  16. Chdir (dirname ($ path ));
  17. Include_once basename ($ path );
  18. Exit;
  19. }
  20. ?>

Index. php and include. inc are in the same directory

  1. Include. inc;
  2. ?>

2. modify links in a program ()

  1. "Index. php? ". Encrypt (" path =/test. php & test = 123 & test2 = 4321 ")

3. modify the POST Form in the program and submit it to add a hidden Form to index. php.

4. modify the path of the front-end Html page baseref =/test

5. write the encryption and decryption functions on your own.

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.