|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
1.中转程序include.inc <? include_once \\'include/Base.php\\'; $path = \\'\\'; $url = isBase::decrypt(urlDecode($_SERVER[\\'QUERY_STRING\\'])); parse_str($url); //获取通过url地址GET传递过来的变量 if(!empty($_POST[\\'path\\'])){ //获取POST传递过来的变量 $path = $_POST[\\'path\\']; $path = isBase::decrypt(urlDecode($path)); } //解析真实路径 if(empty($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 还有更好的方式,就是利用Apache的Url转发的功能,方式已经实现,有时间再贴上来 返回类别: 教程 上一教程: PHP个人网站架设连环讲(一) 下一教程: PHP的面向对象编程:开发大型PHP项目的方式(四) 您可以阅读与"include的妙用,实现路径加密"相关的教程: · Output Buffer (输出缓冲)函数的妙用 · Output Buffer (输出缓冲)函数的妙用 · 修改Zend引擎实现PHP源码加密的原理及实践 · 修改Zend引擎实现PHP源码加密的原理及实践 · php中rename()函数的妙用 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |