SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: referrer help

  1. #1
    SitePoint Member moneybyus's Avatar
    Join Date
    Mar 2001
    Location
    MN
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    referrer help

    I want to record the sites that referrer people to my site, but dont want to record any of my own pages. This is the code i have made right now but it doesnt work.


    if(!eregi("moneybyus\.com", $HTTP_REFERER) {
    dbconnect('moneybyus_com');
    $result = mysql_query("Select * from referrer where url = $HTTP_REFERER");
    if(mysql_result($result,0,0)>0) {
    mysql_query("UPDATE referrer SET num=num+1 where site = '$HTTP_REFERER'");
    }
    if(mysql_result($result,0,0)<1) {
    $sql = "INSERT INTO referrer SET
    site = '$HTTP_REFERER'";
    }
    }


    I dont think that I can put the ! infront of eregi. How else can I do it?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can you are just missing a parantheses on this line:

    PHP Code:
    if(!eregi("moneybyus\.com"$HTTP_REFERER) { 
    should be:

    PHP Code:
    if(!eregi("moneybyus\.com"$HTTP_REFERER)) { 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MOst scripts do the opposite. They record the same information for all hits. Only in the admin reporting section is it broken down and filtered.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by aspen
    MOst scripts do the opposite. They record the same information for all hits. Only in the admin reporting section is it broken down and filtered.
    Yep. It would also be wise not to break down information when a user vists...might have a minimal time lag for the routine checks required.

    then again, another advantage is you can actually decipher your site referer hits...very useful if you just record all referers!
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •