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); } ?> google