操作过程:
1、在系统模型新建一个mima的字段。
2、在内容页对应位置添加如下代码:
<!--密码-->
<?php
if(!$navinfor[mima])
{
?>
你需要输入密码
<?
}else{
?>
<?php
if(isset($_POST['password'])){
$pwd=$_POST['password'];
if($pwd == $navinfor[mima]){
?>
[!--newstext--]
<?
}else{
echo "<script>alert('密码错误');</script>";
}
}
?>
<?
if($pwd !== $navinfor[mima]){
?>
<div class="zz_pic2">
<div class="houhao_top">
<span>此处内容仅供会员查看,请输入验证码后查看本文隐藏内容</span>
<img src="/skin/jxhx/images/wx.png" />
<div class="houhao_search">
<form action="/e/action/ShowInfo.php?classid=[!--classid--]&id=[!--id--]" method="post">
请输入验证码后继续:<input type="password" name="password" placeholder="请在这里输入验证码" class="houhao_bar" />
<input type="submit" value="确认" class="houhaoresults" />
</form>
</div>
<div class="kouhaohuoqu1">
<div class="kouhaohuoqu">
方式1:微信扫码,发送66免费获得验证码
</div>
<div class="timezen">
方式2:猜一猜万一猜对了呢
</div>
<div class="timezen">
方式3:花几秒时间注册个会员免费查看
</div>
</div>
</div>
</div>
<div class="clear"></div>
<?
}
?>
<?
}
?>
<!--密码-->
如果输入密码错误,就提示:密码错误,怎么提示看自己;
如果输入的密码和后台单独设置的一样就显示隐藏的内容,当然想隐藏多少内容,只需放到对应代码里面就行。
3、需要保证这个页面是动态页面。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。