note 29005 added to function.fsockopen

From: Date: Thu, 30 Jan 2003 04:00:08 +0000
Subject: note 29005 added to function.fsockopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-43116@lists.php.net to get a copy of this message
Here is how to connect to the web from behind a proxy server: /*************start code**************/ /*your proxy server address*/ $proxy = "192.168.10.1"; /*your proxy server port*/ $port = 8080; /*the url you want to connect to*/ $url = "http://www.php.net/"; $fp = fsockopen($proxy, $port); fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n"); while(!feof($fp)){ $line = fgets($fp, 4000); print($line); } fclose($fp); /*************end code**************/ -- http://www.php.net/manual/en/function.fsockopen.php http://master.php.net/manage/user-notes.php?action=edit+29005 http://master.php.net/manage/user-notes.php?action=delete+29005 http://master.php.net/manage/user-notes.php?action=reject+29005

« previous php.notes (#43116) next »