隐藏PHP文件名的操作
来源:互联网 发布:app inventor小软件 编辑:程序博客网 时间:2024/06/15 18:14
一 修改http.conf配置文件如下
<IfModule dir_module> DirectoryIndex index.html index.htm index.php index.asp</IfModule><IfModule mod_php5.c> AddType application/x-httpd-php .php .asp .net .jsp AddType application/x-httpd-php-source .phps</IfModule>
二 保存文件,重启Apache服务器
三 创建文件index.php和index_ok.php
代码如下:
index.php
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>隐藏PHP文件扩展名</title> <link rel="stylesheet" type="text/css" href="css/style.css"></head><script src="js/check.js"></script><body><table width="1014" height="706" border="0" align="center" cellpadding="0" cellspacing="0" background="images/form1.jpg"> <tr> <td width="133" height="228"> </td> <td width="750"> </td> <td width="113"> </td> </tr> <tr> <td> </td> <td align="center" valign="top"><form name="form_reg" method="post" action="index_ok.asp" onSubmit="return chkreginfo(form_reg,'all')"> <table width="620" height="262" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="120" height="30"><div align="right">用户名:</div></td> <td colspan="2"> <input type="text" name="recuser" size="20" class="inputcss" onBlur="chkreginfo(form_reg,0)"> <font color="#FF0000">*</font> <div id="chknew_recuser" style="color:#FF0000"></div></td> </tr> <tr> <td height="30"><div align="right">详细联系地址:</div></td> <td height="30" colspan="2"> <input type="text" name="address" size="60" class="inputcss" onBlur="chkreginfo(form_reg,1)"> <font color="#FF0000">*</font> <div id="chknew_address" style="color:#FF0000"></div></td> </tr> <tr> <td height="30"><div align="right">邮政编码:</div></td> <td height="30" colspan="2"> <input type="text" name="postalcode" size="20" class="inputcss" onBlur="chkreginfo(form_reg,2)"><div id="chknew_postalcode" style="color:#FF0000"></div></td> </tr><tr> <td height="30"><div align="right">QQ号码:</div></td> <td height="30" colspan="2"> <input type="text" name="qq" size="20" class="inputcss" onBlur="chkreginfo(form_reg,3)"> <font color="#FF0000">*</font> <div id="chknew_qq" style="color:#FF0000"></div></td> </tr><tr> <td height="30"><div align="right">E-mail:</div></td> <td height="30" colspan="2"> <input type="text" name="email" size="20" class="inputcss" onBlur="chkreginfo(form_reg,4)"> <font color="#FF0000">*</font> <font color="#999999">请务必正确填写您的邮箱</font> <div id="chknew_email" style="color:#FF0000"></div></td> </tr> <tr> <td height="30" align="right">固定电话:</td> <td height="30" colspan="2"> <input type="text" name="gtel" size="20" class="inputcss" onBlur="chkreginfo(form_reg,6)"> <font color="#FF0000">*</font> <font color="#999999"><div id="chknew_gtel" style="color:#FF0000"></div></font></td> </tr> <tr> <td height="30"><div align="right">移动电话:</div></td> <td height="30" colspan="2"> <input type="text" name="mtel" size="20" class="inputcss" onBlur="chkreginfo(form_reg,5)"> <font color="#FF0000">*</font> <div id="chknew_mtel" style="color:#FF0000"></div> <div align="right"></div></td> </tr> <tr> <td height="30"> </td> <td width="150" height="30"><input type="image" src="images/form (2).jpg"> </td> <td width="343"><img src="images/form.jpg" width="72" height="26" onClick="form_reg.reset()" style="cursor:hand"/></td> </tr> </table></form></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr></table></body></html>
index_ok.php
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>隐藏PHP扩展名</title> </head> <style type="text/css"> <!-- .style2 { color: #000000; font-size: 9pt; } .style3 { font-size: 9pt; font-weight: bold; } .style4 {font-size: 9pt} --> </style> <body> <table width="1014" height="706" border="0" align="center" cellpadding="0" cellspacing="0" background="images/form1.jpg"> <tr> <td width="175" height="236"> </td> <td width="501"> </td> <td width="338"> </td> </tr> <tr> <td height="175"> </td> <td valign="top"><table width="88%" border="0" cellspacing="-2" cellpadding="-2"> <tr> <td width="18%" height="22" align="center"><span class="style4">用 户 名:</span></td> <td width="82%" class="style4"> <?php echo $_POST[recuser]; ?></td> </tr> <tr> <td height="22" align="center"><span class="style4">地 址:</span></td> <td height="28" class="style4"> <?php echo $_POST[address];?></td> </tr> <tr> <td height="22" align="center"><span class="style4">邮编:</span></td> <td height="28" class="style4"> <?php echo $_POST[postalcode];?></td> </tr> <tr> <td height="22" align="center"><span class="style4">QQ:</span></td> <td class="style4"> <?php echo $_POST[qq];?></td> </tr> <tr> <td height="22" align="center" style="padding-left:10px"><span class="style4">Email:</span></td> <td class="style4"> <?php echo $_POST[email];?></td> </tr> <tr> <td height="22" align="center" class="style4" style="padding-left:10px">手机:</td> <td class="style4"><?php echo $_POST[mtel];?></td> </tr> <tr> <td height="22" align="center" class="style4" style="padding-left:10px">电话:</td> <td class="style4"><?php echo $_POST[gtel];?><strong></strong></td> </tr> </table></td> <td> </td> </tr> <tr> <td> </td> <td align="center" valign="top"> </td> <td> </td> </tr> </table> </body></html>
四 代码完成后,将上面两个文件的后缀名修改为asp
五 运行结果
第一步:进入网站首页
http://localhost/test/21/13/index.asp
第二步:填写数据,提交数据
第三步:显示数据(http://localhost/test/21/13/index_ok.asp)
![](http://dl2.iteye.com/upload/attachment/0125/2660/842ed265-8a6a-30a1-a90d-384d0dd9e4e5.png)
阅读全文
0 0
- 隐藏PHP文件名的操作
- 并发操作的文件名问题
- linux下文件名的操作
- 对文件名的操作 以及取得相对路径的文件名
- c#opendialog打开文件名对文件名的操作
- PHP:设置文件下载对话框的文件名
- php获得文件名后缀的方法
- php获取不标准的文件名列表
- 修改nginx中php的后辍名文件名
- php获取文件名后缀的方法
- PHP修改指定目录下的文件名
- php获取不带后缀的文件名
- 文件名是否合法的操作(Path.GetInvalidFileNameChars())
- 对文件名及路径的操作
- 对 Linux 文件名中有短横线“-”的操作
- ci的index.php隐藏
- 隐藏index.php的规则
- php隐藏用户的信息
- golang使用二叉树实现排序
- 实现一个 Swiper
- 字体问题记录
- SylixOS网络数据异步处理原理
- eclipse中使用自带git的常用操作
- 隐藏PHP文件名的操作
- php常见的语法错误
- android属性动画
- RDD转化为DataFrames的两种创建方式
- php错误调试
- 通过die和mysql_error语句调试PHP SQL错误
- Hi,腾讯WeTest联合Unity官方打造的性能分析工具UPA,今日全新发布!
- 初探和实现websocket心跳重连
- php数据数据乱码问题