SEO | Link Popularity | Search Engine Consulting | SEO Tutorial | SEO Tools | SEO Forum
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-21-2005, 09:30 PM
viper799's Avatar
viper799 viper799 is offline
SEO
 
Join Date: Nov 2004
Location: Benton, Arkansas
Posts: 184 viper799 is on a distinguished road
Question Need help with a little php script

Hello I need a little help with a php script that I am working on to grab links of a web page then check for my link and display my link and anchor text

here is what I have

Quote:
<?php
// URL1
$url="http://dreamworx.cz/";

// URL2
//$url="http://www.righthanddrivejeeps.us/temp.html";

$domain="www.righthanddrivejeeps.us";
$remote = fopen($url, 'r');
$html = fread($remote, 10342400);
fclose($remote);
preg_match_all("|<[^>]+>(.*)</[^>]+>|U",
$html,
$out, PREG_SET_ORDER);

for ($i=0; $i< count($out); $i++)
{

if (preg_match("/\b$domain\b/i", $out[$i][0])) {
// display if one of the links is my link, full code & anchor text
echo $out[$i][0] . ", " . $out[$i][1] . "<br>";

}
}
?>



I can get url2 to work but not url1 they both have links to the $domain

please I could use some help here I plan to add on to update my link dir DB with the anchor text of the link parnter so I can have an count on the links with the same anchor text.

thanks
__________________
Free Permanent Links - Wholesale Gifts
Reply With Quote
  #2  
Old 02-24-2005, 12:00 AM
l3vi l3vi is offline
SEO Almost
 
Join Date: Nov 2004
Posts: 119 l3vi is on a distinguished road
Code:
<?
function URLopen($url)
{
       // Fake the browser type
       ini_set('user_agent','MSIE 4\.0b2;');
       $dh = fopen("$url",'r');
       $result = fread($dh,8192);    
	   fclose($dh);                                                                                                                       
       return $result;
}
$SearchDomain = URLopen('http://dreamworx.cz/');
$MyDomain = "www.righthanddrivejeeps.us";
preg_match_all("|<[^>]+>(.*)</[^>]+>|U", $SearchDomain, $Match, PREG_SET_ORDER);
 foreach ($Match as $value){
	if (preg_match("/\b$domain\b/i", $value)) { 
	echo "Link found<br>\n"; 
	}
}
?>


The cz site is a super spam site.. Has your link almost 100 times.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Login/Register
User Name
Password
Remember Me?

Forum Links
Forum Home
SEO Forum
Internet Marketing Forum
Web Design Forum
Web Hosting Forum
Programming Forum
SEO Chat

Quick Links
Forum Home
New Posts
Mark Forums Read
Open Buddy List
User Control Panel
Edit Avatar
Edit Profile
Edit Options
Miscellaneous
Subscribed Threads
My Profile

Search Forums

Advanced Search
All times are GMT -8. The time now is 10:59 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.