View Single Post
Old 05-02-2008, 10:06 AM  
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Quote:
Originally Posted by Wolfy View Post
Got a link?
Easiest is with PHP, but you could also use javascript to produce the cookies. Sessions are over-rated and actually have several flaws upon creation...not to mention you need to watch your coding habits while working with sessions. I prefer cookies because of those reasons.

Quote:
<?php
// for page 1
$ipp = $_SERVER['PHP_SELF'];
setcookie('my_page1', $ipp, (time()+12800), '/', '', 0);

// for page 2
setcookie('my_page2', $ipp, (time()+12800), '/', '', 0);

// etc

// to check page 1
if(isset($_COOKIE['my_page1'])){
echo 'User has viewed page 1.';
}

// to check page 2
if(isset($_COOKIE['my_page2'])){
echo 'User has viewed page 2.';
}

// etc.
?>
You really should just hire a programmer to do it though. It's actually quite simple.

Last edited by Nookster; 05-02-2008 at 10:07 AM..
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote