用PHP3作树型目录(2)

发表于:2007-07-01来源:作者:点击数: 标签:
? require(/commonfuncs. php 3); require(home/websrc/userfuncs.php3); function makeloginform(){ echoPlease login firstbr; echoform action+; echo $GLOBALS[ PHP _SELF]; if(!$HTTP_COOKKIE_VARS[UserID]){ if(!$UserName){ makeloginform(); 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;
   }
  ?>

原文转自:http://www.ltesting.net