RE: Need some help from PHP developers...

[email protected] ("Johan Holst Nielsen") Fri, 26 Nov 2004 13:35:10 +0100
Newsgroups php.evangelism
Message-ID <[email protected]>
Bahadur writes:
> Let me introduce my self. I am final year student of IT.
> I am very much interested in programming languages, and accept chalanges.
> Right now i m working on my final year project, and i need some help from
> professional PHP Developers.  
> 
> I am creating a web application that when user fills the form on my web sign
> in page.
> i-e: Field are
> Wesite URL :
> email :
> When user submit after providing the infomation then first it searches
> either that domain is registered or not that user provides Website URL
> field.If the domain is not registered then it generates error "Your website
> is not registered". If the domain is registered then it searcg for the
> perticualar word on users website that i'll provide it.
> And is this possible to find how many pages are there in website that user
> provides ?, and can we scan all of them ?  
> 
> I will be thank full to you if you solve my problem.
> Please response me at my email address
> [email protected]
 

The easiest way would be something like following: 

<?php
// $_POST['website'] = The website value from the user 

$searchForWord = 'php'; 

/*
Check if the website is a HTTP address - we dont want people to load local 
files ;)
*/
if(!eregi("^http\:\/\/",$_POST['website'])) {
echo "The website you entered is not valid! Please remeber to start with 
http://";
exit;
}
$fp = fopen($_POST['website'],'r');
while(!feof($fp)) {
if(stristr($searchForWor,fgets($handle, 4096)) !== false) {
   echo "Word was found!";
   break;
}
}
fclose($fp);
?> 

Hope that helps you on the way :) 


 -- Johan Holst Nielsen
Freelance PHP Developer 

[email protected]
www.phpgeek.dk