Jump to content

What am I doing wrong with this fsockopen script???


emc2k99

Recommended Posts

???[code]<?php

$x='sourceid=navclient-ff&ie=UTF-8&rlz=1B2GGGL_enUS177&q=tube+socks';
//$x = 'p=tube+socks&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8';
//$x='fr=FP-pull-web-t';
//$x='';
$f=fsockopen('www.google.com',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {

$wr="GET /search HTTP/1.1\r\n
Host: www.google.com\r\n";
$wr.="Location: www.google.com/search?sourceid=navclient-ff&ie=UTF-8&rlz=1B2GGGL_enUS177&q=tube+socks";
//$wr="Allow: GET, HEAD, PUT\r\n";
$wr.="Content-Type: application/x-www-form-urlencoded\r\n";

//$wr.="Content-Type: */*\r\n";
$wr.="User-Agent: Firefox 2.0\r\nContent-length: ";

$wr.=strlen($x)."\r\nConnection: close\r\n\r\n$x";

fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,(1024 * 50));
}
fclose($f);
}
?>
[/code]

Trying to figure out what I'm doing wrong with this, basically trying to pull up the search results...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.