Home > php教程 > php手册 > 在PHP3中实现SESSION的功能(二)

在PHP3中实现SESSION的功能(二)

WBOY
Release: 2016-06-13 12:37:53
Original
1325 people have browsed it

COOKIE函数库:cookie.inc.php3

if (!isset($__cookie_inc__)){
$__cookie_inc__=1;
function JsSetCookie($CName,$CValue,$CExpr=FALSE){  
// 这个函数允许你在HTML头标记之后设置cookie ,
// 可以作SetCookie函数的补充,甚至代替。  
// $CName.....: cookie 的名字
// $CValue....: cookie 的值
// $CEXpr.....: cookie 的有效期,以分钟为单位,也可以修改加入小时,天数

if($CExpr > 0){  
$CookieString="astr= '$CName' + '=' + '$CValue' + ';expires=' + expr + ';path=/';";  
$Cookie.="nn";  
}else{  
$Cookie.="nn";  
}  
echo $Cookie;  
}  
}
?>   

原作者:不详  

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template