cookies question

A

Anonymous

Guest
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?
 
yes.

links.htm

<a href=/link.php?jumpto=http://www.ua-design.net/>Ua-Design.net - creative webdesign agency</a>

link.php
<?
setcookie ('site', $_GET['jumpto'], time()+30*60*60);
hesder ("Location: $_GET[jumpto]");
?>
 
okay i not all that fimiliar with php wut am i sposed to do with the link.php, do i make that a file?
 
Any errors!?

Downloading..!? Are you sure you have php suport!?
Maybe you need to 'AddType' in the httpd.conf!
 
i fogrot to make it a html document and add the tag in now it goes to the file but nothin happens it just sits there this is wut i have for the link


<center><a href=/C:\humpy\ps2\manuals\link.php? jumpto="upload.html"/>Send Me Your Manuals</a><br>

(i am testing this on my comp before i upload it)

and in the link.php i have this

<?
setcookie ('PS2Manuals', $_GET['jumpto'], time()+60*60*24);
header ("support.html": $_GET[jumpto]");
?>
<html>
<body>
</body>
</html>

does anybody see the problem there????
 
you need to make sure your test server on your computer allows you to actually use PHP... if not, just test on the actual server - it won't hurt it!

Andrew
 
okay heres wut i got


<html>
<body bgcolor="#000000" link="#FFA500" vlink="#FF0000" text="#1E90FF" alink="#1E90FF">
<center>
<font size="4">

<?
$filename = $_GET['support.html'];

if (isset($_COOKIE['PS2Manuals'])) {
$cookieData = $_COOKIE['PS2Manuals'];

//maybe do some more checking here

header ("Location: $filename");
} else {
//show error message

print "You must visit this sponsor before you can download this file.";
}
?>

and i get this error
Warning: Cannot modify header information - headers already sent by (output started at /home/humpy/public_html/download.php:6) in /home/humpy/public_html/download.php on line 14

anybody know why?
 
Back
Top