![]() |
PHP Guru - need your help
How can I force an HTTP GET request through a proxy server with PHP ?
Right now I use this function to send my info : function myPost($URL, $script, $data){ $sock = fsockopen($URL, 80, $errno, $errstr); fputs($sock, "GET ".$script." HTTP/1.0\r\n"); fputs($sock, "Host:".$URL."\r\n"); fputs($sock, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($sock, "Content-length: " . strlen($data) . "\r\n"); fputs($sock, "Accept: */*\r\n"); fputs($sock, "\r\n"); fputs($sock, "$data\r\n"); fputs($sock, "\r\n"); fclose($sock); } Thanks for any help ! |
bump 8 char
|
fputs($sock, "Host:".$URL.":8080\r\n");
Missing port ? Other than that I can't see much wrong, although I'm tired and can't think straight atm >_< |
no the function is working fine but it's not going through a proxy as it is.
I guess my question should be more like how do you interact with a proxy in php. Can't find much doc on this subject ... |
Here, I'll save you some time. Rewrite for cURL. It'll save you many, many, many headaches.
Code:
$ch = curl_init(); |
Quote:
|
Thanks ! Does the job perfectly !
|
All times are GMT -7. The time now is 07:47 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123