帝国cms系统 密码功能实现 下载链接输入密码
博主:紫藤心-迷途
浏览次数:2262次
帝国cms 输入密码才能下载,可以修改下载系统,增加一个名为pass的字段,然后修改模型,再修改公共模板"最终下载页模板"
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>[!--pagetitle--]</title> <meta name="keywords" content="[!--pagekey--]"> <meta name="description" content="[!--pagedes--]"> <link href="../../data/images/qcss.css" rel="stylesheet" type="text/css"> </head> <body> <br> <br> <br> <br> <?php if(!$r[pass]) { ?> <table align="center" width="100%"> <tr> <td height="32" align=center> <a href="[!--down.url--]" title="[!--title--] -[!--down.name--]"> <img src="../../data/images/download.jpg" border=0> </a> </td> </tr> <tr> <td align=center>(点击下载)</td> </tr> </table> <br> <? }else{ ?> <?php if(isset($_POST['password'])){ $pwd=$_POST['password']; if($pwd == $r[pass]){ ?> <table align="center" width="100%"> <tr> <td height="32" align=center> <a href="[!--down.url--]" title="[!--title--] -[!--down.name--]"> <img src="../../data/images/download.jpg" border=0> </a> </td> </tr> <tr> <td align=center>(点击下载)</td> </tr> </table> <br> <? }else{ echo "<script>alert('密码错误');</script>"; } } ?> <? if($pwd !== $r[pass]){ ?> <div style="text-align:center;">请输入密码后继续:<br> <form action="" method="post"> <input style="border:1px solid #3374b4;height:33px;line-height:33px;padding-left:5px" type="password" name="password"> <input style="border:1px solid #3374b4;background:#3374b4;padding:10px 10px;color:#fff;text-decoration:none;vertical-align:top" type="submit" value="下 载"></form> </div> <? } ?> <? } ?> </body> </html>
当前是最后一篇文章