Results 1 to 3 of 3
-
02-08-2012, 10:38 AM #1
Freshman
- Join Date
- Feb 2011
- Posts
- 21
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
php - save the referring site's url
I’d like to save the referring page to my site – only external sources and then pass it in a session to another page where I log this url.
My site uses the index.php file to connect to all pages of the site (like a global include). So my problem is that I do record the referring url, but it is erased if a user passes from page to page – my script writes the previous page, instead of just saving the entrance url and that’s it.
Anyone can help here?
-
02-08-2012, 05:54 PM #2
You could try passing the url through on each page, or alternatively storing the urls in a MYSQL Database.
-
02-12-2012, 07:14 AM #3
Freshman
- Join Date
- Mar 2011
- Posts
- 31
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
You can pass a visitors referer information around the site using $_session
PHP Code:<?php
session_start();
if(!isset($_SESSION[’referrer’])){
//get the referrer
if ($_SERVER[’HTTP_REFERER’]){
$referrer = $_SERVER[’HTTP_REFERER’];
}else if (($referrer = "unknown" ){
/// no referer
}
else if (($referrer = "mysite" ){
///
}
else {
//save it in a session
$_SESSION[’referrer’] = $referrer; // store session data
}
?>Lovelogic.net Personal Projects Pit: Uk Job scanner | Radio Station and more coming.. link spammers welcome
Similar Threads
-
How to save your self from Reverse SEO???
By pankaj11 in forum Search Engine OptimizationReplies: 1Last Post: 12-08-2011, 06:07 AM -
How can i save my PC to hackers
By habibpkck in forum Computer and TechReplies: 4Last Post: 04-27-2011, 04:08 AM -
Who would you save?
By DC23MVP in forum General TalkReplies: 23Last Post: 02-19-2011, 11:59 AM -
Want to Save Time, Money & Lots of Effort While Continually Increasing the Traffic to Your Site?
By Anwar in forum ServicesReplies: 0Last Post: 05-30-2010, 06:48 PM -
New to phpLinkBid? Save 40%
By Tekime in forum Marketplace - Buy, Sell & TradeReplies: 1Last Post: 05-09-2009, 08:44 AM


Reply With Quote

