I am new to PHP
This is Google search results in your site or localhost
Here is the code but I am stuck the page does not go to 2 page
Please advice
<form action="search.php" method="POST">
<input type="text" name="search">
<input type="submit" value="Search">
</form>
if (@$_POST['search']==""){
echo "What are you doing?";
}
else{
$query = file_get_contents("http://www.google.com/search?q=".urlencode($_POST['search'])."&num=100&hl=en&ie=UTF-8&filter=2");
//needs to be added with more queries
$replace_array = array('/\n/','/<head>(.*)<\/head>/','/(.*)<div id=res>/','/<br clear=all>(.*)/');
//pregraplacing unneeded parts
$results = preg_replace($replace_array, '', $query);
echo $results;
}
?>
The next page is not displayed
Please advice