Use PHP Include to implement path Encryption

Source: Internet
Author: User

1. TransitProgramInclude. inc
CopyCode The Code is as follows: <?
Include_once 'include/base. php ';
$ Path = '';
$ Url = isbase: decrypt (urldecode ($ _ server ['query _ string']);
Parse_str ($ URL); // get the variable passed through the URL address get
If (! Empty ($ _ post ['path']) {// get the variable passed by post
$ Path = $ _ post ['path'];
$ Path = isbase: decrypt (urldecode ($ PATH ));
}
// Parse the actual path
If (empty ($ PATH )){
// Header ("Location: Login. php ");
Exit;
}
If (! Preg_match ("/(^ http: \/) | ([? | & | =])/", $ PATH )){
// Jump to the path of the actual execution File
Chdir (dirname ($ PATH ));
Include_once basename ($ PATH );
Exit;
}
?>

Index. php and include. inc are in the same directoryCopy codeThe Code is as follows: <?
Include include. Inc;
?>

2. Modify links in a program ()
Copy codeThe Code is as follows: "index. php? ". Encrypt (" Path =/test. php & test = 123 & Test2 = 4321 ")

3. Modify the post form in the program
All forms are submitted to index. php.
Add a hidden form in the middle

4. Modify the path of the front-end HTML page
Baseref =/test

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

Summary:
This method is cumbersome and can only hide the background script path. The Front-End Script path can still be seen in the source file (baseref). The address displayed in the address bar is index. php? XXXXXXXX

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.