Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

131 users online



set cookie

set cookie

Currently viewing this thread: 1 (0 members and 1 guests)


mo_jam

mo_jam

none
Status: Offline!

set cookie

Hi Guys,
Please I wondered if anyone could tell me why this code is not working for me.
I was supposed to see "I am the cookie" when the page is
reloaded. But I got no reply.
Please can anyone assist the poor guy???
Thanks a lot.
Jam

PHP:



<?php

setcookie
("my_cookie","I am the cookie!",time()+3600,"/");

    if ( ! 
$_COOKIE['my_cookie'] )
    {
        echo 
"Reload this page to see cookie..";
    }
    else
    {
        echo 
$_COOKIE['my_cookie'];
    }
?>

___________________

:hmm

CDude

CDude

nothing
Status: Offline!
PHP:


<?php
setcookie
('my_cookie','hello, i am a cookie.  i taste good.',time()+3600,'/');
if(!isset(
$_COOKIE['my_cookie'])) {
    print 
'Refresh';
} else {
    print 
$_COOKIE['my_cookie'];
}
?>

___________________

http://celerondude.com

_uG_

_uG_

Status: Offline!

Do you get a blank page or the "Reload this page to see cookie.." message?

mo_jam

mo_jam

none
Status: Offline!

I got only
"Reload this page to see cookie.." message.
and nothing else

___________________

:hmm

_uG_

_uG_

Status: Offline!

Try what CDude made or use $HTTP_COOKIE_VARS instead of $_COOKIE

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.007 seconds.