Jump to content

Link verification with PHP


assasin

Recommended Posts

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;
[list]
[*]Link URL
[*]Link Name
[/list]

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?
Link to comment
Share on other sites

I can't think of any way to determine that a specific image is actually [i]visible[/i] 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.hotscripts.com/search/12084309.html
Link to comment
Share on other sites

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/graphic.php?their_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. :)
Link to comment
Share on other sites

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.

Cheers
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.