萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> 用PHP3作樹型目錄

用PHP3作樹型目錄

   require("/commonfuncs.PHP3");

  require("home/websrc/userfuncs.php3");

  function makeloginform(){

  ???echo"Please login first

  ";

  ???echo"

  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;

  ???}

  ???>

copyright © 萬盛學電腦網 all rights reserved