本例以整合home为例 home的登录系统中加入的防伪码主要是三个:
define('IN_UCHOME','asdfasdf'); // 加载dzhome的基本配置文件 include .'/home/data/data_config.php'; // 生成防伪 $action_login = md5('login'.md5($_SCONFIG['sitekey'])); $action_register = md5('register'.md5($_SCONFIG['sitekey'])); $action_formhash = substr(md5(substr(time(), 0, -7).'0'.md5($_SCONFIG['sitekey']).''.$hashadd), 8, 8); echo ' <script> var loginNum = "',($action_login = md5('login'.md5($_SCONFIG['sitekey']))),'"; var registerNum = "',($action_register = md5('register'.md5($_SCONFIG['sitekey']))),'"; var formhashNum = "',($action_formhash = substr(md5(substr(time(), 0, -7).'0'.md5($_SCONFIG['sitekey']).''.$hashadd), 8, 8)),'" </script> <ul class="login"> <form name="loginform" action="/home/do.php?ac=',$action_login,'&&ref" method="post"> <input type="text" name="username" size="10" value="用户名"> <input type="text" name="password" size="9" value="密码"> <input type="hidden" name="refer" value="space.php?do=home" /> <input type="hidden" name="formhash" value="',$action_formhash,'"> <input type="submit" value="登陆" class="int" name="loginsubmit"> <input type="button" name="regbutton" class="int" value="注册" class="button"> <input type="button" value="忘记密码" class="int" > </ul> </form> |
时间: 2024-11-01 05:38:59