![]() |
|
|
#1
|
||||
|
||||
|
Search/Matching Code
Here's what I need - to provide a URL and a chunk of HTML to a function, and have it return a boolean if it finds the HTML on the specific page.
So: checklinks($url, $html) Where: $url = "http://www.example.com/pagexyz.html"; $html = "<a href=\"http://www.example.com\">Example Link</a> - This is sample description text to go with my link."; Basically I'm building a script to check if people are keeping their reciprocal links to my sites. I appreciate the help
__________________
Get 20,000 Twitter Followers -------------------- Earn Between $10 - $1,000/week Posting on Forums
|
|
#2
|
||||
|
||||
|
use the file() function to suck the page into a var.
Then use strpos() or a preg function to check if it is there. You may also want to check if it is nofollow or not ![]() That is the quick and dirty method. I would use cURL instead and XML DOM functions to test all <a> tags. That will prevent your code being fooled or throwing false negatives/positives. Slightly more complicated but works best in my experience. There are tonnes of scripts around to do what you are looking for. Are you doing this as an exercise to learn or what? |
|
#3
|
||||
|
||||
|
php Code:
__________________
PHP Goodies |
|
#4
|
||||
|
||||
|
Quote:
__________________
Get 20,000 Twitter Followers -------------------- Earn Between $10 - $1,000/week Posting on Forums
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Matching the adsense code to my site better | mikey1090 | Placement / Reviews / Examples | 3 | Dec 11th 2007 8:20 am |
| Search code Problem | Alistair | ASP | 2 | Apr 13th 2007 1:25 pm |
| Broad matching vs Exact matching? | wzl | Yahoo Search Marketing | 3 | Aug 21st 2006 3:20 am |
| Website stats not matching Yahoo search stats | CDavis | Pay Per Click Advertising | 0 | Nov 16th 2005 10:16 pm |
| Can you use the Adsense search code forr froogle and local search? | crazyhorse | AdSense | 2 | Apr 16th 2005 5:47 am |