RE: [PHP] PHP Cookies

2002-05-20 Thread Jay Blanchard

[snip]
Hi, i want to use a cookie to set a skin for a site but when i go to the
site when there is no cookie set then it will display no images background
colors ect... So what i need to do is have a command that will set other
images background ect. as default if there is no cookie there.  How can i
acheave this.
[/snip]

check for cookie
if no cookie exists use defaults, else use information from cookie to set
skin.

Jay

We are all apparently 'net' literate, why don't we use it to get the
information we need? After all, isn't that what a Google search is all
about?

Give a man a program, frustrate him for a day. Teach a man to program,
frustrate him for a lifetime.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP Cookies

2002-05-20 Thread Miguel Cruz

On Mon, 20 May 2002, Darren Edwards wrote:
 Hi, i want to use a cookie to set a skin for a site but when i go to the
 site when there is no cookie set then it will display no images background
 colors ect... So what i need to do is have a command that will set other
 images background ect. as default if there is no cookie there.  How can i
 acheave this.

if ($cookie_was_set)
{
  // set images and background based on cookie contents
}
else
{
  // set default images and background
}

Surely there's some more challenging aspect to your query but I'm at a 
loss as to what it is.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP Cookies

2002-05-20 Thread Miguel Cruz

[ by the way Darren, your email address doesn't work ]

On Mon, 20 May 2002, Darren wrote:
 Ok what i mean is this if the $skin cookie is not present then what can i
 add to this so that it has a default value with the color #00
 
 if($skin==default) { $skin=#6e6e6e; };
 if($skin==red) { $skin=#FF; };

switch($_COOKIE['skin'])
{
case 'red':
  $framecolor = '#ff';
  $backgroundcolor = '#e6ffd8';
  break;
case 'blue':
  $framecolor = '#66';
  $backgroundcolor = '#aa2231';
  break:
default:
  $framecolor = '#00';
  $backgroundcolor = '#99cc99';
}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php