Home > php教程 > php手册 > body text

在PHP3中实现SESSION的功能(二、COOKIE函数库:cookie.inc.php3)(转译)

WBOY
Release: 2016-06-21 09:13:36
Original
1535 people have browsed it

cookie|session|函数

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.="\n\n";
}else{
$Cookie.="\n\n";
}
echo $Cookie;
}
}
?>



Related labels:
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