Code Library
Home Submit Free Hosting Link To Us Contacts

PHP Google Search Results

PHP Google Search Results PHP PHP Google Search Results Download (.zip)



<?
if($search) {
        $fp = fsockopen ("www.google.com", 80, $errno, $errstr, 30);
        fputs ($fp, "GET /search?btnI=&q=".urlencode($search)." HTTP/1.0\r\n\r\n");
        while (!feof($fp)) {
                $line=fgets ($fp,128);
                if(strstr($line,"Location: ")) {
                        $url=substr($line,strlen("Location: "));
                        header("Location: ".$url);
                }
        }
        fclose ($fp);
}
?>
<html>
<head>
        <title>google</title>
</head>
<body>
<form>
        <input type="text" name="search">
        <input type="submit">
</form>
</body>






Tatet