Implementing the SESSION function in PHP3 (3)_PHP Tutorial

WBOY
Release: 2016-07-21 16:01:57
Original
972 people have browsed it

示例程序:test_session.php3

require("cookie.inc.php3");
?>
session_checkid( 20 ); //20分钟后session失效
//下面你需要设置mysql的连接参数
mysql_connect('localhost','user','pass') or Die("can't connect to db!");  
?>  

  

Session/Cookie-测试  
  

This Page should show how to handle the "session.inc.php3" library


We will use a mask with a record showing routine

  
if( $show ) {  
if( session_read() ) {  
$username = $session[username];  
$userpass = $session[userpass];  
echo "

session[username]:$username
session[userpass]:$userpass";
}
}  
else{
$session[username]="yourid";
$session[userpass]="12345";
if( !session_write() ) {  
print $sess_error;  
}else{
echo "

session[username]被设置成:$session[username]
" ;
echo "session[userpass]被设置成:$session[userpass]
" ;
echo "测试一下SESSION的作用" ;
}
}
?>

  
   

原作者:不详  

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316697.htmlTechArticle示例程序:test_session.php3 ?php require( session.inc.php3); require(cookie.inc.php3); ? ?php session_checkid( 20 ); //20分钟后session失效 //下面你需要设置mysql的连...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template