Page 1 of 1

cookie question

Posted: Sat May 29, 2004 9:28 pm
by humpy
is it possible to set a cookie only when someone clicks a link from your page to another persons page, so that you can later check there cookies to see if they have visited that link?

Posted: Sat May 29, 2004 11:17 pm
by James M.
I belive it is, you just have to set a way to make the link activate the if statement of function you are using to set the cookie like this:

page.php?setcookie=yes

there might be a better way but thats how i would do it

Posted: Sat May 29, 2004 11:41 pm
by feyd
you could set up a redirect page, that sets the cookie, then bounces them to the real page..

[edit] something like this: not tested

sending page:

Code: Select all

...<a href="redir.php?www.google.com">
redir.php :

Code: Select all

<?php

$addr = $_SERVER['REQUEST_URI'];

set_cookie('wee','they were ''ere!');

header("Location: $addr");

?>