当前位置: 首页 > 图文教程 > 网络编程 > PHP > 整合Discuz用户登陆代码

PHP
URL Rewrite的设置方法
php和js交互一例-PHP教程,PHP应用
推荐个功能齐全的发送PHP邮件类
推荐php模板技术[转]
菜鸟学PHP之Smarty入门
Smarty模板快速入门
笑谈配置,使用Smarty技术
SMARTY学习手记
如何隐藏你的.php文件
phpfans留言版用到的数据操作类和分页类
phpfans留言版用到的install.php
用php实现像JSP,ASP里Application那样的全局变量
自动分页的不完整解决方案
FCKeditor的安装(PHP)
mysql5详细安装教程
isset和empty的区别
php5.2时间相差8小时
安装APACHE
PHP has encountered an Access Violation
MYSQL环境变量

PHP 中的 整合Discuz用户登陆代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-17   浏览: 337 ::
收藏到网摘: n/a

本例以整合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>