用PHP3作树型目录(2)
时间:2007-02-17 来源:PHP爱好者
<?
require("/commonfuncs.PHP3");
require("home/websrc/userfuncs.PHP3");
function makeloginform(){
echo"Please login first<br>";
echo"<form action ";
echo $GLOBALS["PHP_SELF"];
if(!$HTTP_COOKKIE_VARS["UserID"]){
if(!$UserName){
makeloginform();
exit;
}
if(!$userinfo=getuserbyname($UserName))){
echo "Login Name Error!";
exit;
}
if($userinfo->password!=$Password){
echo "Login Password Error!";
exit;
}
$conn=DBConnect();
$sql="insert into useronline(uid,logintime,username)values(";
$sql=$sql.$userinfo->name;
$sql=$sql."')";
mysql_query($sql,$conn);
DBClose($conn);
if(!(setcookie("UserID",$userinfo->id,"","/"))){
echo"Set Cookie Error!!";
exit;
}
$strHeader="Location:".$PHP_SELF;
header($strHeader);
exit;
}
?>
php爱 好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
require("/commonfuncs.PHP3");
require("home/websrc/userfuncs.PHP3");
function makeloginform(){
echo"Please login first<br>";
echo"<form action ";
echo $GLOBALS["PHP_SELF"];
if(!$HTTP_COOKKIE_VARS["UserID"]){
if(!$UserName){
makeloginform();
exit;
}
if(!$userinfo=getuserbyname($UserName))){
echo "Login Name Error!";
exit;
}
if($userinfo->password!=$Password){
echo "Login Password Error!";
exit;
}
$conn=DBConnect();
$sql="insert into useronline(uid,logintime,username)values(";
$sql=$sql.$userinfo->name;
$sql=$sql."')";
mysql_query($sql,$conn);
DBClose($conn);
if(!(setcookie("UserID",$userinfo->id,"","/"))){
echo"Set Cookie Error!!";
exit;
}
$strHeader="Location:".$PHP_SELF;
header($strHeader);
exit;
}
?>
php爱 好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
相关阅读 更多 +