Diamond7 Posted October 8, 2020 Share Posted October 8, 2020 Hi I need a script to hide IP address with proxy and read a web page $username="myuser"; $password="mypass"; $url = "http://www.mysite.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_PROXY, '173.234.11.134'); curl_setopt($ch, CURLOPT_PROXYPORT,'80'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); $output = curl_exec($ch); $info = curl_getinfo($ch); echo $output; curl_close($ch); The script doesn't work, it doesn't show me the page output. Any solution? Quote Link to comment https://forums.phpfreaks.com/topic/311579-hide-the-ip-with-proxy/ Share on other sites More sharing options...
gw1500se Posted October 8, 2020 Share Posted October 8, 2020 First, please use the code icon (<>) for your code and specify PHP. As for your specific problem, you are not checking for errors. Make sure you use error_reporting(E_ALL); at the beginning of the script to debug. You probably need to use a try/catch for your production version to handle errors. Quote Link to comment https://forums.phpfreaks.com/topic/311579-hide-the-ip-with-proxy/#findComment-1581766 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.