I planed to create a search engine that searches .exe files in a webpages it is possible to create a search engine with the use of PHP alone and also I need do the Page rank concepts also???
are you searching a directory in your server, or info in a database? the database search is easy. the directory search would be a little harder.
what is difference between searching directory or information? I need to store the newly designed site into the database and the database should store the full information about the site including the .exe file details, according to the user keywords the list of sites should be listed according to the page rank. I did not need other directory sites help ..
Yes, it's very possible. You might want to take a look here for some coding examples: http://www.hotscripts.com/category/php/scripts-programs/search-engines/
thanks for your site whitehatseo. I need some coding example but in that site they giving softwares like that.
Yes it is possible to easily create .exe search engine. Regarding PR, you need to learn about Google data center.
As has been said... Yes you can create a search engine using php. However, personally, I would use PERL for the actual search process.
Ya you can do anything with PHP,,,, there are lots of opensource php scripts for search engine,,,, you can even use google to find and filter the results,,,,
Hey I have another doubt I just referred about robot.txt file and also about user-agent scripts. I don't know how the user-agent script will read the robot.txt file. whether any script is there for reading the robot.txt file content??
You could trey aleadsoft search builder pro because I use that software and it allows php usage and even mysql usage. That means you can store all your search engine crawls data in a php file or mysql database.
It will be better this way $robots=@file_get_contents ('http://microchipinf.com/robots.txt'); PHP: The @ suppresses errors if the file does not exist.
Iam executing the PHP script I got this errors can any one help what this error indicates. "catchable fatal error: Object of class DOM Element could not be converted into string in C:\xampp\htdocs\index.php" I got this error while Iam executing the curl script and DOM element.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $receivedurl=$_REQUEST["urltxt"]; $keywords=$_REQUEST["keywordtxt"]; $desc=$_REQUEST["desctxt"]; echo "<br>".$receivedurl; echo "<br>".$keyword; echo "<br>".$desc; $last=strrpos($receivedurl,"/"); $url=substr($receivedurl,0,$last); $homeurl=substr($receivedurl,$last); echo "<br>".$last; echo "<br>".$url; echo "<br>".$homeurl; include "connection.php"; $query = "INSERT INTO homesite (urlid, url, homeurl, pagerank, description, keywords) VALUES (NULL, '".$url."', '".$homeurl."',0,'".$desc."','".$keywords."')"; mysql_query($query); echo " Inserted Successfully"; //$receivedurl=$_REQUEST[urltxtbox]; $fullurl = "http://".$url; echo "<BR>".$fullurl.$homeurl; searchLink($url,$homeurl); function importAgent($target_url) { //$target_url = "http://".$target_url; //$target_url = "http://localhost/aaa/".$receivedurl; echo $target_url; $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; // make the cURL request to $target_url $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $html= curl_exec($ch); if (!$html) { echo "<br />cURL error number:" .curl_errno($ch); echo "<br />cURL error:" . curl_error($ch); exit; } // parse the html into a DOMDocument $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the on the page $xpath = new DOMXPath($dom); return $xpath; } function storeLink($software,$fullurl,$url) { include "connection.php"; $query="SELECT Name FROM categories"; $cat_list = mysql_query($query); $query="SELECT urlid FROM categories where url='".$url."'"; $urlid = mysql_query($query); $xpath = importAgent($fullurl); $metas = $xpath->evaluate("/html/head//meta"); for ($i = 0; $i < $metas->length; $i++) { $meta = $metas->item($i); $content = $meta->getAttribute('content'); echo "META: ".$meta; while($category=mysql_fetch_array($cat_list)) { if(strpos($content,$category)>=0) { $query = "INSERT INTO antivirus (suburl, software, title, metatag, h1, clicks, urlid) VALUES ('$fullurl', '$software', NULL, '$meta', NULL, NULL, $urlid)"; echo "<br> hi"; mysql_query($query);// or die('Error, insert query failed'); } } } } function searchLink($url, $receivedurl) { $target_url = "http://".$url.$receivedurl; $xpath = importAgent($target_url); $hrefs = $xpath->evaluate("/html/body//a"); for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i); $linkurl = $href->getAttribute('href'); $exe = strrchr($linkurl,"."); echo "<BR>".$linkurl." - "; if($exe==".exe") { storeLink($linkurl,$target_url,$url); echo $exe." Succss"; } else if($exe==".html" || $exe==".htm" || $exe==".php" || $exe==".asp" || $exe==".aspx" || $exe==".xml" || $exe==".xmls") { $linkurl="/".$linkurl; searchLink($url, $linkurl); } else { echo $exe." Failed"; //storeLink($url,$target_url); //echo "<br />Link stored: $url"; } } } ?> </body> </html> PHP: I got the error in line 81 ?