Jump to content

get results from external search engine


farkewie

Recommended Posts

hello,

i want to make  a page to search multiple sites at once like www.torrentz.com.

 

i dont know where to start. i have looked at google but got nothing. i know how to make a form search1 nd results shown on thier page but i want it to display results on my page with rankings like the page above.

 

a link on where to get started would be great.

 

Link to comment
https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/
Share on other sites

cURL

file_get_contents()

regex

 

^^^ That's all you should need :)

 

Hello this is as far as i have gotten.

 

<?php

$url = 'http://search.com/files/?query=keyword';
list($protocol, $uri) = split('//', $url);
$html = file_get_contents($protocol . '//' . $uri);

?>

 

i end up with the whole origional page displayed with no css?

 

what i really want is to just get some of the values like file name, link seeds and peers. so i can sort and display them how i want? any help would be great.

 

NB: this is just my simple test sript when i get the working as i need ill startadding  all other sites and security and stuff

I'm sure something like this will work:

 

html form:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Samuel Boulton">

<title>Untitled 3</title>
</head>

<body>

<form method="post" action="google.php">
<label for="search">Enter your search criteria</label>
<input type="text" name=search id=search>
<input type=submit name=submit value="Google Search!!">
</form>

</body>
</html>

 

google.php

<?php

$user_data = $_POST['search'];

$response = file_get_contents("http://www.google.co.uk/search?hl=en&q=".$user_data."&btnG=Google+Search&meta=");
echo $response;
?>

 

Sam

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.