用PHP3作树型目录(2)
类别: 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;
}
?>
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;
}
?>
- 上一篇: 一个判断oicq是否在线的小程序
- 下一篇: 用PHP3作树型目录(1)
-= 资 源 教 程 =-
文 章 搜 索