Jump to content

PHP Meta Search Engine Help .. nid to make query dynamic ...


ameykhandeparkar

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.