FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > PHP, Perl, Python and/or MySQL
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 01-20-1999, 02:49 PM   Postid: 42301
Jacob Stetser
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: Decatur, GA 30032
Posts: 447
Help with cookies?

Hi

I need to write a little PHP scriptlet on my index page that will let me test for the existence of a certain cookie and-

if it exists: redirect the user to another page.

if it doesn't: set the cookie for the user.

How do I go about doing this?

I know how to set the cookie, but I'm not very familiar with PHP.. learning.. and I don't know how to check for the value.. hmm

nor do I know how to redirect...

and I don't know how to structure it

Help!

Jacob Stetser is offline   Reply With Quote
Old 01-20-1999, 03:37 PM   Postid: 42302
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
http://www.php.net

Great place to learn. There's a lot of stuff there. Just do a search for "http cookie". I saw it there somewhere, and there's also something on "http redirect". It's all listed under "http headers".

Justin
-- Still trying to figure out http uploading --
Justin is offline   Reply With Quote
Old 01-20-1999, 03:53 PM   Postid: 42303
Jacob Stetser
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: Decatur, GA 30032
Posts: 447
Figured it out!

It's fun to accomplish something you didn't know you could do:

Here's the code...

<?php
if(isset($testcookie))
{
//Gotosuccess-page
Header( "Location:http://www.somewhere.com");
}
else
{
// Set a cookie so next time they go to the right page
SetCookie("testcookie","test",time()+36000000);
}

//Goodbye
?>

Yay

Jacob Stetser is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:51 AM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.