PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to allow multiple IP ranges. The script below works up until I want to add another IP range. Instead of only allowing the IP range, it allows all. I've tried changing $ip to $ip2, and $check to $check2, but nothing. Any suggestions?
Technically you're supposed to use Apache (or whatever web server software you're using) to accomplish this. I don't whitelist IP addresses in Apache which is what it looks like what you're trying. I'd recommend posting in the Miscellaneous about Apache IP white list range...an accurate description of what I think you're attempting to do here with PHP.
If that's really your code, all you are doing is checking to see that a number is what you already defined it to be, so sure, it will have no bearing on what IP address is requesting the page.
JAB Creations had it right, you shouldn't be trying to do this in your application code, it's part of the Apache security system.