It is currently Sat Apr 27, 2024 11:09 am



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
global variables and sessions... 
Author Message
Duke
User avatar

Joined: Mon Mar 31, 2003 8:59 am
Posts: 1358
Location: right behind you
Reply with quote
Post 
Aren't you sassy.

1. Yes you can.
Make your link like so: page.php?flash=2
On your cookie script: if( $_GET['flash'] == 2 ) setcookie("clankiller", "1", time()-60*60*24*30, "/");
You will see this in the code below. BTW, it is also a good idea to specify all 6 parameters for setcookie(), as some browsers won't accept the cookie otherwise.

2. See the code below and ask questions if it still doesn't make sense.

3. That's right. You'll take it and like it!

4. Cool. I'll assume you updated flash=2 instead of 0.

Code:
//cookie.txt
if( $_GET['flash'] == 1 )
{
     setcookie("clankiller_flash", 1, time() +60*60*24*365, "/", ".clankiller.com", 0);
     header("Location:" . $_SERVER['PHP_SELF']);
}
elseif( $_GET['flash'] == 2 )
{
     setcookie("clankiller_flash", 1, time() -60*60*24, "/", ".clankiller.com", 0);
     header("Location:" . $_SERVER['PHP_SELF']);
}

//where you want your menu
if( $_COOKIE['clankiller_flash'] == 1 ) include("flashmenu.txt");
else include("non_flashmenu.txt");



Tue Nov 04, 2003 9:23 am
Profile YIM WWW
Felix Rex
User avatar

Joined: Fri Mar 28, 2003 6:01 pm
Posts: 16650
Location: On a slope
Reply with quote
Post 
ok, I got it taken care of. Worked with no major problems, and I understand all the code. I also got rid of my session(); statements, since they're no longer needed.

Only snag I ran into was me forgetting that php root != htdocs/. That was no biggie, though.

I'm going to concentrate on the flash/nonflash menus/headers and general page prettiness for a bit. I'll let you know if I have any more issues with the php side of things once I get that far.

Thanks for the assistance, Piglet!

_________________
They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety.


Wed Nov 05, 2003 2:36 am
Profile WWW
Duke
User avatar

Joined: Mon Mar 31, 2003 8:59 am
Posts: 1358
Location: right behind you
Reply with quote
Post 
Glad to be of service.


Wed Nov 05, 2003 8:53 am
Profile YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 57 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.