PHP Google Search Results

Google Search Results

<?
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>