Jump to content

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

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.