Deanznet Posted December 11, 2009 Share Posted December 11, 2009 the Proxy is a HTTP and it is good i check it? Just a white page?!@ <? $url = 'http://www.whatismyip.com/'; $cUrl = curl_init(); curl_setopt($cUrl,CURLOPT_VERBOSE,1); //curl_setopt($cUrl,CURLOPT_HTTPPROXYTUNNEL,true); curl_setopt($cUrl,CURLOPT_PROXYTYPE,CURLPROXY_HTTP); curl_setopt($cUrl,CURLOPT_PROXY,'68.32.66.6:9090'); curl_setopt($cUrl,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($cUrl,CURLOPT_URL,$url); curl_setopt($cUrl,CURLOPT_TIMEOUT,320); $PageContent = curl_exec($cUrl); curl_close($cUrl); echo $PageContent; ?> Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 Hmm.. shot in the dark but have you tried not using 'short_open_tags'? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 11, 2009 Share Posted December 11, 2009 it is displaying the information correctly there is nothing wrong in the code. have u checked whether the open tags is on or off as the other user specified Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 11, 2009 Share Posted December 11, 2009 you did not include the return transfer option curl_setopt($cUrl,CURLOPT_RETURNTRANSFER,1) Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 Actually using 'CURLOPT_RETURNTRANSFER' returns the string, instead of outputting it directly. Either way his code *should* display the result. Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 11, 2009 Share Posted December 11, 2009 if u give a resturntransfer then it will show you a exact blank page with out any result, so dont go for it.. Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 if u give a resturntransfer then it will show you a exact blank page with out any result, so dont go for it.. $PageContent = curl_exec($cUrl); curl_close($cUrl); echo $PageContent; He's storing the return of curl_exec() within the "$PageContent" var, then echoing it out. With RETURNTRANSFER set to true it wouldn't matter because he's echoing the var, with it set to false it also wouldn't matter because the content would be outputted directly by curl_exec(). Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 11, 2009 Share Posted December 11, 2009 if u give a resturntransfer then it will show you a exact blank page with out any result, so dont go for it.. $PageContent = curl_exec($cUrl); curl_close($cUrl); echo $PageContent; He's storing the return of curl_exec() within the "$PageContent" var, then echoing it out. With RETURNTRANSFER set to true it wouldn't matter because he's echoing the var, with it set to false it also wouldn't matter because the content would be outputted directly by curl_exec(). if u place the curl_setopt($cUrl,CURLOPT_RETURNTRANSFER,1); before the curl_setopt($cUrl,CURLOPT_URL,$url); then it will provide u with the blank page.. if u put it afterwards then it will display a page with the result.. Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 if u place the curl_setopt($cUrl,CURLOPT_RETURNTRANSFER,1); before the curl_setopt($cUrl,CURLOPT_URL,$url); then it will provide u with the blank page.. if u put it afterwards then it will display a page with the result.. Mmm, not for me it doesn't? Do you have a link or anything that states this? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 11, 2009 Share Posted December 11, 2009 try it out http://www.drvirusindia.co.cc/chaitu/ipchgprxy.php Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 That link just times out.. Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 11, 2009 Share Posted December 11, 2009 thtz wt, if u try in the localhost it works fine,but when u upload it to any server, then it goes on for a timeout. Quote Link to comment Share on other sites More sharing options...
Adam Posted December 11, 2009 Share Posted December 11, 2009 I don't see what that proves? Quote Link to comment Share on other sites More sharing options...
Deanznet Posted December 11, 2009 Author Share Posted December 11, 2009 I tried long tags <?php and such.. But still doesn't work. Is it the proxy's timing out or what? Maybe my host? Anyone get it to work on their servers? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 11, 2009 Share Posted December 11, 2009 using the return transfer it did work on my test server, I however would opt for the returntransfer it will give you more control over your script content. Quote Link to comment Share on other sites More sharing options...
Deanznet Posted December 11, 2009 Author Share Posted December 11, 2009 Okay wait so i need to add curl_setopt($cUrl,CURLOPT_RETURNTRANSFER,1) ? Do i take out my $PageContent = curl_exec($cUrl); curl_close($cUrl); echo $PageContent; ?? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 11, 2009 Share Posted December 11, 2009 nope it should be <? $url = 'http://www.whatismyip.com/'; $cUrl = curl_init(); curl_setopt($cUrl,CURLOPT_VERBOSE,1); //curl_setopt($cUrl,CURLOPT_HTTPPROXYTUNNEL,true); curl_setopt($cUrl,CURLOPT_PROXYTYPE,CURLPROXY_HTTP); curl_setopt($cUrl,CURLOPT_PROXY,'68.32.66.6:9090'); curl_setopt($cUrl,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($cUrl,CURLOPT_URL,$url); curl_setopt($cUrl,CURLOPT_TIMEOUT,320); curl_setopt($cUrl,CURLOPT_RETURNTRANSFER,1); $PageContent = curl_exec($cUrl); curl_close($cUrl); echo $PageContent; ?> Quote Link to comment Share on other sites More sharing options...
Deanznet Posted December 11, 2009 Author Share Posted December 11, 2009 Hey thanks! but still cant get it to work.. Could the white page be a time out?? Im on godaddy shared hosting, If i use a GoDADDY proxy server like this curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128"); It works. but i cant use any other proxies ? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 12, 2009 Share Posted December 12, 2009 I tried it on my godaddy login and it does not work, you should contact godaddy customer support to ask them why its not working Quote Link to comment 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.