ameykhandeparkar Posted December 1, 2010 Share Posted December 1, 2010 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")); ?> Link to comment https://forums.phpfreaks.com/topic/220332-php-meta-search-engine-help-nid-to-make-query-dynamic/ Share on other sites More sharing options...
chmpdog Posted December 8, 2010 Share Posted December 8, 2010 what are you trying to do again? Link to comment https://forums.phpfreaks.com/topic/220332-php-meta-search-engine-help-nid-to-make-query-dynamic/#findComment-1144248 Share on other sites More sharing options...
ameykhandeparkar Posted December 8, 2010 Author Share Posted December 8, 2010 my dear friend, i am trying to store the query in a variable and pass that variable in the echo function instead of statically passing the query .... but because the different search engines have different criterian to allow to pass query to them .. i am stuck Link to comment https://forums.phpfreaks.com/topic/220332-php-meta-search-engine-help-nid-to-make-query-dynamic/#findComment-1144394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.