Cookie Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lawksalih
Forum Newbie
Posts: 6
Joined: Mon Aug 06, 2007 10:25 am

Cookie Help

Post by lawksalih »

Hi,

I have a php page which displays a flash introduction before the visitor reaches the actual index page of the website. I want to give the user the ability to disable the intro page next he/she visits the site. Could this be done via cookie settings? If so, how.

Your help is appreciated.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

setcookie() and then use the $_COOKIE superglobal array to check.
lawksalih
Forum Newbie
Posts: 6
Joined: Mon Aug 06, 2007 10:25 am

Post by lawksalih »

So if I set a cookie on their machine, how can I then return them to a URL. Btw, don't mind the expiration:

Code: Select all

<?php
$value = 'FlashPage';

setcookie("mycookie", $value);
setcookie("mycookie", $value, time()+3600);  
?>
Thanks.
Last edited by lawksalih on Fri Aug 24, 2007 9:22 am, edited 1 time in total.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Use $_COOKIE to read'em and decide what to do :)
There are 10 types of people in this world, those who understand binary and those who don't
lawksalih
Forum Newbie
Posts: 6
Joined: Mon Aug 06, 2007 10:25 am

Post by lawksalih »

Got it. Thanks for your help.
Post Reply