ionicle Posted April 29, 2013 Share Posted April 29, 2013 Hey there, gals and guys, here's the deal:I'm trying to integrate a layer of open proxy blocking in my website. I found out a pretty nifty tool for that - http://www.shroomery.org/ythan/proxyblock.php . What I want to do is, create a PHP snippet that would be inserted in the header section of each one of my HTMLs/PHPs. The snippet would have to extract the REMOTE_ADDR from the request to it, and substitute it in:http://www.shroomery.org/ythan/proxycheck.php?ip=x.x.x.xThen do a query at that URL, and, according to the single character returned as an answer, define two separate possible actions:1. Y ( originating IP is identified as a proxy server ): deny access to the resource2. N or X ( originating IP is not a proxy server, found in the database ): load resource as usualAny idea on how to do that?I will be adding another snippet to make sure that no regular proxy headers are allowed too, but the example above would be really useful for me to deny access to a wide array of open proxies, that could be classified as anonymous. Quote Link to comment Share on other sites More sharing options...
Solution lemmin Posted April 29, 2013 Solution Share Posted April 29, 2013 Like this? $ip = $_SERVER['REMOTE_ADDR']; $response = file_get_contents('http://www.shroomery.org/ythan/proxycheck.php?ip='.$ip); if ($response == 'Y') echo 'Proxy'; else echo 'Not Proxy'; Quote Link to comment Share on other sites More sharing options...
ionicle Posted April 30, 2013 Author Share Posted April 30, 2013 Great, just what I needed! Hugely appreciated! 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.