I wrote a script. I'm using file_get_contents function. With this function i'm getting a domain adress and taking something from this page. But i'm getting rapidly. script always uses file_get_contents For example google.com for example if you make 900 or more searchs per a day google blocks you. I have same problem with another site. So i want to use proxy with my script while using file_get_contents. maybe i can solve this issue. Think like your computer. It will change proxy in the script. How can i do it ? With which function ? Thank you
I tried it but it doesn't show me the content .Am i doing something wrong ? <? $cUrl = curl_init(); curl_setopt($cUrl, CURLOPT_URL, "http://www.google.com"); curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($cUrl, CURLOPT_TIMEOUT, 'timeout_in_seconds'); curl_setopt($cUrl, CURLOPT_PROXY, '164.58.18.25:80'); $pageContent = trim(curl_exec($cUrl)); curl_close($cUrl); echo $pageContent; ?> Code (markup):
I pust it but no change and not set_curlopt - curl_setopt <? $cUrl = curl_init(); curl_setopt($cUrl, CURLOPT_HTTPPROXYTUNNEL, true); curl_setopt($cUrl, CURLOPT_URL, "http://www.google.com"); curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($cUrl, CURLOPT_TIMEOUT, 'timeout_in_seconds'); curl_setopt($cUrl, CURLOPT_PROXY, '164.58.18.25:80'); $pageContent = trim(curl_exec($cUrl)); curl_close($cUrl); echo $pageContent; ?> Code (markup):
What makes you so sure that 164.58.18.25:80 is even a valid proxy? It doesn't work from here in Firefox...