farkewie Posted December 21, 2007 Share Posted December 21, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/ Share on other sites More sharing options...
rajivgonsalves Posted December 21, 2007 Share Posted December 21, 2007 you can do it with curl I did something similar before... don't have any code now... but if I find anything will post it. Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/#findComment-420336 Share on other sites More sharing options...
chigley Posted December 21, 2007 Share Posted December 21, 2007 cURL file_get_contents() regex ^^^ That's all you should need Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/#findComment-420339 Share on other sites More sharing options...
farkewie Posted December 22, 2007 Author Share Posted December 22, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/#findComment-420967 Share on other sites More sharing options...
helraizer Posted December 22, 2007 Share Posted December 22, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/#findComment-420969 Share on other sites More sharing options...
farkewie Posted December 22, 2007 Author Share Posted December 22, 2007 Thanks but all that does is show the google page with my servers addres int he address bar. Quote Link to comment https://forums.phpfreaks.com/topic/82646-get-results-from-external-search-engine/#findComment-420981 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.