PHP Meta Search Engine
I am a Student of ME in IT Engineering, I am developing a Meta Search Engine i have developed first Phase of Search Engine ... But my query passing is Static .... Can anyone please help me in how to make it Dynamic plzzzzzzzzzzzzzzzzzzzzzzzzzzz
Here is my code:
/* Html form */
<form action="search.php" method="post" style="margin-top:80px">
<div align="center"><span style="color: #CC0066"><strong style="font:Arial, Helvetica, sans-serif; font-size:36px; text-align:center; text-decoration:none; color:#666666">Ameya Meta QA System</strong></span><br/>
<input name="fname" type="text" size="100px" style="margin-top:20px; margin-bottom:20px"/>
<br/>
<input type="submit" />
</div>
</form>
/* Php Logic */
<?php
function getData($URL){
//Giving the String URL as argument it returns all webpage as a String to you
$allPage = "";
if($URL == null){ //Checking provided URL
echo("<b><font color=\"red\">Please specify a URL to get data from </font></b>");
}
$fp= fopen($URL, r); //Opening Connection
if ( !$fp ) { // Check connection
echo("<b><font color=\"red\">Connection Failed</font></b>");
}
else{
$num=0;
while ( !feof($fp) ){
$pageText[$num] = fread($fp,1024);// read WebPage
$num++;
}
//endwhile;
}
$arrayLen=count($pageText);
for($i=0; $i<$arrayLen; $i++){
$allPage=$allPage.$pageText[$i];
}
fclose($fp);
return $allPage;
}
//===Example of usage of function===
echo(getData("http://in.answers.yahoo.com/search/search_result;_ylt=ArpvqsO11GkfsRGXnPrC7jm5HQx.;_ylv=3?scope=all&category=0&fltr=in_&question_status=all&answer_count=any&date_submitted=all&crumb=zSToR%2Fo4fY9&p=who+is+obama+%3F&orderby=rank&filter_search=true"));
echo(getData("http://www.answers.com/topic/barack-obama"));
echo(getData("http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=who+is+obama+%3F&button="));
echo(getData("http://www.chacha.com/search/who+is+obama+%3F"));
?>