SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Apr 10, 2007, 06:01 #1
- Join Date
- May 2004
- Location
- London
- Posts
- 123
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Newbie help, How to get a referal and keep it?
Hello guys!
I want to keep the referal information in a session in my site but don't want to loose it everytime the visitor returns to my homepage from an internal page.
What I mean is, I have this in my index.php:
PHP Code:<?php
session_start();
header("Cache-control: private");
$visref = $HTTP_REFERER;
$_SESSION['visref'] = $visref;
?>
How can I do this?
Thanks!
-
Apr 10, 2007, 06:20 #2
- Join Date
- May 2005
- Location
- London, ON
- Posts
- 360
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Check if that session variable is already set. If it is, don't set it again. See this page: http://www.tizag.com/phpT/phpsessions.php and scroll down to the title "PHP Sessions: Using PHP's isset Function"
Bookmarks