帝国cms要实现输入密码才能下载内容的办法,可以增加一个mima字段,然后修改模型,再修改公共模板变量,下面的方法供大家参考

<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[mima])
{
?>
<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[mima]){
?>
<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[mima]){
  ?>
 
<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>

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。