??? cs5 ?? ?? ?? ?? ???? php ??? ??? [??]
Jul 29, 2016 am 08:36 AMPHP ??:
/*
* ??: CnkknD PHP ??? ???
* ??: MySQL ?? ???? ???? PHP ???
* ???: Daniel King, cnkknd@ 163.com
* ??: 2003/8/25
*/
class ???
{
var $username; //??? ??
var $userpass
var $userid; //??? ID
var $userlevel; //??? ??
var $authtable="account"; //?? ??? ???
var $usecookie=true; sessionid
var $cookiepath='/'; //?? ??
var $cookietime=108000; //?? ?? ??
var $err_mysql="mysql error"; var $err_username="??? ??? ???????"; //??? ??? ???????.
var $err_user="???? ???????"; //???? ???????(???)
var $err_password="???? ??"; message
var $err; //?? ???
var $errorreport=false; //?? ??
function Login($dbserv,$dbport,$dbuser,$dbpass,$dbname) //???, ??????? ??
{
if(@mysql_pconnect($dbserv.":".$dbport,$dbuser,$dbpass))
{
mysql_select_db($dbname)}
else
{
$this->err_mysql)
$this->err=$this->err_mysql;
function isLoggedin() //??? ?? ??
{
if(isset($_COOKIE['sid'])) //??? ??? sid? ?? ??
{
session_id($_COOKIE['sid']);
session_start();
$this->username=$_SESSION['username']
$this->userid=$_SESSION[ 'userid'];
$this->userlevel=$_SESSION['userlevel'];
return true
}
else //sid? ??? ???? ?? ?? ?? ?? ??
{
session_start();
if(isset($_SESSION['username']))
return true;
}
return false;
?? userAuth($username,$userpass) //??? ??
{
$this->username=$username;
$this->userpass=$userpass
$ query=" `".$this->authtable."`?? * ??, ??? `username`='$username';"
$result=mysql_query($query)
if(mysql_num_rows($) result)! =0) //? ???? ????
{
$row=mysql_fetch_array($result)
if($row['bannd']==1) //? ???? ???????
{
$this->errReport($this->err_user)
$this->err=$this->err_user
return false
} >elseif( md5($userpass)==$row['userpass']) //???? ??
{
$this->userid=$row['id']
$this- >userlevel =$row['userlevel'];
return true;
}
else //????? ???? ????
{
$this->errReport($this-> ;err_password);
$this->err=$this->err_password;
return false
}
}
else //? ???? ?? ? ????
{
$this ->errReport($this->err_username);
$this->err=$this->err_username;
return false; ??>function setSession( ) //?? ??
{
$sid=uniqid('sid'); //sid ??
session_id($sid)
session_start(); $_SESSION['username']=$this->username; //?? ??? ? ??
$_SESSION['userid']=$this->userid; _SESSION['userlevel']=$ this->userlevel; //..
if($this->use_cookie) //sid? ???? ?? ??? ???? ??
{
if(!setcookie ('sid',$sid,time( ) $this->cookietime,$this->cookiepath))
$this->errReport("?? ?? ??")
}
else
setcookie('sid', '',time()-3600); //??? sid ???
}
function userLogout() //??? ????
{
session_start( );
unset($_SESSION ['username']); //???? ??? ?? ???
if(setcookie('sid','',time()-3600))
//sid ??? ????
return true
else
return false
}
function errReport($str) //?? ??
{
if($this->error_report )
?? "??: $str"
}
}
?>?
mysql中表? ??
??:
CREATE?TABLE?`account`?(
??`id`?bigint(20)?NOT?NULL?auto_increment,
??`username`?varchar(255)?NOT?NULL?default?' ',
??`userpass`?varchar(255)?NOT?NULL?????'',
??`banned`?tinyint(1)?NOT?NULL?????'0',
??`userlevel`?tinyint(4)?NOT?NULL?????'0 ',
????????(`id`)
)?
使用一例
PHP代碼:
'../myclasses/Login.php'? ?????.
$dbserv="localhost";
$dbport="3306";
$dbuser="??";
$dbpass="123456";
$dbname="???";
$login=new????($dbserv,$dbport,$dbuser,$dbpass,$dbname);
$login->error_report=true;
$login->cookietime=3600*24*30;
if($login->isLoggedin())
{
echo $login->username."??? ????????.";
}
elseif($login->userAuth("danielking","1234"))
{
echo "??? ??";
$login->setSession();
}
???"
...
";/*
if($login->userLogout())
echo "????";
??? ???
echo "???? ??";
*/
?>??
?
以上就介紹了photoshop cs5 官方中文正式原版下載 php的一個登錄的類 [推薦],包括了photoshop cs5 官方中文正式原版下載方了內(nèi)容,希望對PHP教程有興趣的朋友有所幫助。

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.
