I was sat here wondering, with hardly no knowledge of PHP. Would it be possible to detect a proxy and block it - without a list of host names, ip's and stuff. I'd like to see if any of you more knowledgable, more experienced users think it is possible, your opinion on the matter. Well, that's all.
Its not possible. After all, a proxy si just another computer. If you are speaking about a webproxy like hidemyass etc., then you can use framebreaker for atleast some respite. Though, that won't give total blockign of web proxiews also, only those with frame will be disabled.
I guess Glype and/or PHProxy had some User agent defined, so you can block them <?php $agent = $_SERVER["HTTP_USER_AGENT"]; // Define the user agent (browser name) if(preg_match("/glype|phproxy/",$agent) die("You're on proxy :P"); // IF glype OR phproxy can be found in user agent, kill the script with an error message else { echo "Here's your content, you don't really have to use else here, you could just continue with your script because IF glype or phproxy is detected in user agent, script will die with an error message"; } ?> PHP:
The above code will error. You're missing a ) for the preg_match condition. And I'm pretty sure that code won't detect those proxies. The user agent will remain whatever your browser is set at, whether you're using a proxy or not.
agree if it was easy like user agent to detect a proxy i am sure sites like paypal would implement it too
@CoreyPeerFly Sorry, I always miss something without syntax highlighting And since they use Curl to do the browsing part, your User Agent wont be sent to the remote site (in case the proxy script doesn't fetch yours and then uses it, I haven't been into the code that hard so I've no idea)
blocking proxies is almost impossible. proxy is another normal computer. you cannot block normal PC..