1.中轉程序include.inc
- <?
- include_once 'include/Base.php';
- $path = '';
- $url = isBase::decrypt(urlDecode($_SERVER['QUERY_STRING']));
- parse_str($url); //獲取通過url地址GET傳遞過來的變量
- if(!emptyempty($_POST['path'])){ //獲取POST傳遞過來的變量
- $path = $_POST['path'];
- $path = isBase::decrypt(urlDecode($path));
- }
- //解析真實路徑
- if(emptyempty($path)){
- //header("Location: login.php");
- exit;
- }
- if(!preg_match("/(^http:/)|([?|&|=])/",$path)){
- //跳轉到實際執行文件的路徑
- chdir(dirname($path));
- include_once basename($path);
- exit;
- }
- ?>
index.php與include.inc同目錄
- <?
- include include.inc;
- ?>
2.修改程序中的鏈接()
- "index.php?".encrypt("path=/test/test.php&test=123&test2=4321")
3.修改程序中的POST表單
Form都提交到為 index.php,中間加一個隱藏表單 <hidden name=path value="/test/test.php">
4.修改前端Html頁面的路徑:baseref=/test
5.加解密函數就由自己提供了
總結:用這種方法比較繁瑣,只能隱藏后臺腳本的路徑,前端的腳本路徑仍然可以在源文件中看得到(baseref),在地址欄上看到的地址都是index.php?xxxxxxxx.
新聞熱點
疑難解答