Any PHP or server gurus around tonight?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BigBen
    Confirmed User
    • Nov 2004
    • 2299

    #1

    Any PHP or server gurus around tonight?

    Is there a way to use an image to track what URL somebody came from when they view the page with the image on it? I created a php file which outputs an image and stores HTTP_REFERER, but this just shows the URL that the actual image is loaded on. I want to see the URL that they came from.

    Any ideas?
  • Superterrorizer
    Confirmed User
    • Sep 2003
    • 509

    #2
    Originally posted by BigBen
    Is there a way to use an image to track what URL somebody came from when they view the page with the image on it? I created a php file which outputs an image and stores HTTP_REFERER, but this just shows the URL that the actual image is loaded on. I want to see the URL that they came from.

    Any ideas?


    Uhmm... I'd look at the http server logs. But that's just me. Why waste cpu cycles tracking shit that the webserver is tracking already?

    Comment

    • Killswitch - BANNED FOR LIFE

      #3
      maybe try something like viewimg.php?ref=<?php echo $HTTP_REFERER; ?> for the image location, then have viewimg.php load the image and get the referrer?

      no idea if it works, never tried it, just an idea

      Comment

      • mrthumbs
        salad tossing sig guy
        • Apr 2002
        • 11702

        #4
        Originally posted by BondOfBabesDotCom
        maybe try something like viewimg.php?ref=<?php echo $HTTP_REFERER; ?> for the image location, then have viewimg.php load the image and get the referrer?

        no idea if it works, never tried it, just an idea
        yeah.. that should do it. it wipes out everything after the first '&' in the refering url but you probably dont need that info anyway

        Comment

        • BigBen
          Confirmed User
          • Nov 2004
          • 2299

          #5
          Originally posted by BondOfBabesDotCom
          maybe try something like viewimg.php?ref=<?php echo $HTTP_REFERER; ?> for the image location, then have viewimg.php load the image and get the referrer?

          no idea if it works, never tried it, just an idea
          Well, I'm going to put the image src on myspace, so the php won't work. I already have to parse .jpg as php. Maybe some javascript?

          Comment

          • J.P.
            Confirmed User
            • Jun 2004
            • 689

            #6
            something like this:

            Code:
            <script type="text/javascript">
            docref = '';
            if (document.referrer) docref=escape(document.referrer);
            document.write('<img src="counter.gif?ref=' + docref + '">');
            </script>
            Last edited by J.P.; 04-22-2006, 12:07 AM.
            Webmasters! Looking for new affiliate programs to promote?
            Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

            Comment

            Working...