Jump to content

HTTP_X_FORWARDED_FOR to ban proxy?


Dragen

Recommended Posts

Hi,

I've been trying to figure out how to ban proxys from accessing certain parts of my site.. here's my code:

<?php
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
echo "yes";
}else{
echo "no";
}
?>

As expected when I access the page it outputs no, but I just did a google search for proxy servers to test with and I when I used it, it still outputted no. Surely it should've been yes if I'm using a proxy...

could anyone help me here?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/51232-http_x_forwarded_for-to-ban-proxy/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.