Hello :D i have 1 problem :-?
how to use curl with proxy ? :-? i want to use another ip not mine (server ip)
i try something like that but doesn`t work :-?
you know another code/way to do that ? :-?
how to use curl with proxy ? :-? i want to use another ip not mine (server ip)
i try something like that but doesn`t work :-?
Code:
<?php $proxy = ""; //<-optional proxy IP $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://site.com'); curl_setopt($ch, CURLOPT_HEADER, 1); if($proxy){ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY, "$proxy"); } $data = curl_exec($ch); curl_close($ch); ?>
Comment