PHP用户权限设置.doc
文本预览下载声明
PHP用户权限设置
导读:就爱阅读网友为您分享以下“PHP用户权限设置”的资讯,希望对您有所帮助,感谢您对92的支持!
PHP会员登录,和判断用户权限,登录使用时间是否超时
2010-08-05 17:39:48| 分类: 阅读415 评论0 中小 订阅
config.php
lt;?php
session_start();
//PHP程序开发,主要是写出方法,PHP会员登录,和判断用户权限,登录使用时间是否超时!
//编辑者:黎经真,QQ:451798640
//编写一个小小的PHP会员登录
//
$conn=mysql_connect(#39;localhost#39;,#39;root#39;,#39;a123456#39;) or die(quot;连接错误quot;); mysql_select_db(quot;xuexiquot;,$conn) or die(quot;数据库错误quot;);
mysql_query(quot;set names#39;utf8#39;quot;);
define(ALL_PS,quot;ljzhenquot;);//为ljzhen在做加密,保证用户的安全性。 function user_shell($uid,$shell,$yid){ //这里定义了变量
$sql=quot;select * from login_user where `uid`=#39;$uid#39;quot;;
$query=mysql_query($sql);
$us=is_array($row=mysql_fetch_array($query));
$shell=$us ? $shell=md5($row[username].$row[userpass].ALL_PS) :FALSE; if($shell){
if($row[yid]lt;=$yid){ //判断用户权限,条件满足时,即可访问该页面 return $row;
}else{
显示全部