function here_setcookie($name, $value, $expire, $path='/')
{
if (headers_sent()) {
$cookie = $name.'='.urlencode($value).';';
if ($expire) $cookie .= ' expires='.gmdate('D, d M Y H:i:s', $expire).' GMT';
echo '<script language="javascript">document.cookie="'.$cookie.'";</script>';
} else {
setcookie($name, $value, $expire, $path);
}
setcookie("C_id" ,$row['ID'] ,30*24*60*60+time() ,"/" );
here_setcookie("C_id" ,$row['ID'] ,30*24*60*60+time() ,"/" );
출처 : http://blog.naver.com/nugu99/70008603717 고맙다...
{
if (headers_sent()) {
$cookie = $name.'='.urlencode($value).';';
if ($expire) $cookie .= ' expires='.gmdate('D, d M Y H:i:s', $expire).' GMT';
echo '<script language="javascript">document.cookie="'.$cookie.'";</script>';
} else {
setcookie($name, $value, $expire, $path);
}
setcookie("C_id" ,$row['ID'] ,30*24*60*60+time() ,"/" );
here_setcookie("C_id" ,$row['ID'] ,30*24*60*60+time() ,"/" );
출처 : http://blog.naver.com/nugu99/70008603717 고맙다...
'php' 카테고리의 다른 글
strip_tags 함수 (0) | 2010.01.19 |
---|---|
php 이클립스에서 개발하기 (0) | 2010.01.08 |
Apache Module mod_rewrite 사용하기 (0) | 2009.12.14 |
Cookie 와 Session (0) | 2009.12.08 |
$_SERVER["HTTP_REFERER"] 란? (0) | 2009.12.08 |