Jump to content


Link verification with PHP

  • Please log in to reply
3 replies to this topic

#1 assasin

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 23 September 2006 - 11:30 AM

I have an idea for a link exchange but have no idea on how to implemet it :(

I would have a link exchange sign up page with the following fields that would be entered into a database;
  • Link URL
  • Link Name

Quite easy realy but upon someone entering these details they would be given a banner, just a small gif to place onto the front page of their website and what I would like my links page to do is only display the link if my banner is on their website.

Does anybody have any ideas on how I would achieve this?

#2 AndyB

  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 23 September 2006 - 02:09 PM

I can't think of any way to determine that a specific image is actually visible on a particular web site.

Yes, it might be on the server - but not included on any page
Yes, it might be included in some page - but wrapped with a CSS 'hide' tag

Maybe you'll find something useful at http://www.hotscript...h/12084309.html
Legend has it that reading the manual never killed anyone.
My site

#3 pkSML

  • Members
  • PipPipPip
  • Advanced Member
  • 191 posts
  • LocationBucyrus, Ohio

Posted 23 September 2006 - 03:39 PM

Two ideas for ya':

1) Make the GIF banner be printed with a PHP script. (My signature graphic below is an example. It's generated by a PHP script.)
Each person that enters information for your link referral program should have an associated name (link name, perhaps). The code you give them should be http://your-site.com...heir_link_name.
With that PHP script (graphic.php), keep a list of those link names that have requested the image (like in linknames.txt). That proves that they have the image in their HTML.
On your links page, check each link name against linknames.txt. If it's not there, don't display their link.

2) PHP could fetch each page and find the URL to your gif file in their HTML. Note: Fetching external websites and verifying an image to be in their HTML code in real-time takes quite a bit of time.

P.S. Does this make any sense to you? It makes sense in my mind, at least. :)

Need a LitlURL?

Got code to share? --> The Code-Bin

#4 assasin

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 September 2006 - 12:47 AM

Cheers guys, I had a look at those scripts and as usual each one is way too much then what I need :) but all useful.

pkSML - I hear what you are sayign with idea 1 and this could quite easily be implemented with a cron job so it will only run every say 12 hours instead of every time a visitor hits my page and idea 2 I could use wither a PHP curl or file_get_contents command which will probably be the quickest.

I will look into these tomorrow.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users