Results 1 to 3 of 3
  1. #1
    datrader is offline Freshman
    Join Date
    Feb 2011
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default 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?

  2. #2
    jcourtenay's Avatar
    jcourtenay is offline Guardian
    Join Date
    Jan 2011
    Location
    Wirral, UK
    Posts
    3,730
    Thanks
    22
    Thanked 19 Times in 19 Posts
    Feedback Score
    0

    Default

    You could try passing the url through on each page, or alternatively storing the urls in a MYSQL Database.
    Free web space from Worlditsme, offering free web hosting packages and free php hosting

  3. #3
    Cybrax is offline Freshman
    Join Date
    Mar 2011
    Posts
    31
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    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

  1. How to save your self from Reverse SEO???
    By pankaj11 in forum Search Engine Optimization
    Replies: 1
    Last Post: 12-08-2011, 06:07 AM
  2. How can i save my PC to hackers
    By habibpkck in forum Computer and Tech
    Replies: 4
    Last Post: 04-27-2011, 04:08 AM
  3. Who would you save?
    By DC23MVP in forum General Talk
    Replies: 23
    Last Post: 02-19-2011, 11:59 AM
  4. Replies: 0
    Last Post: 05-30-2010, 06:48 PM
  5. New to phpLinkBid? Save 40%
    By Tekime in forum Marketplace - Buy, Sell & Trade
    Replies: 1
    Last Post: 05-09-2009, 08:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS