Letterbomb05 Posted May 17, 2010 Share Posted May 17, 2010 Hi, I'm looking to write a script that would limit access to certain computers or such using an IP whitelist or access list, or at least something along those lines. However, I am aware that IP addresses for most people are always changing, which would be a bit of a problem. Has anyone written one of these before or have knowledge on how this can be achieved? I'm not asking anyone to write one for me, just guidance on how to go about creating it Cheers. Link to comment https://forums.phpfreaks.com/topic/202073-ip-whitelistaccess-list-help/ Share on other sites More sharing options...
scampbell Posted May 17, 2010 Share Posted May 17, 2010 $_SERVER['REMOTE_ADDR'] var contains the persons IP. As for dynamic IPs, there isnt much you can do about that. Link to comment https://forums.phpfreaks.com/topic/202073-ip-whitelistaccess-list-help/#findComment-1059667 Share on other sites More sharing options...
bulrush Posted May 17, 2010 Share Posted May 17, 2010 Yup. My IP at work is the same all the time. But if I want to do some work from my home PC, my home PC IP is always changing, so I wouldn't be able to do work if someone blacklisted all IPs but our work IPs. Link to comment https://forums.phpfreaks.com/topic/202073-ip-whitelistaccess-list-help/#findComment-1059685 Share on other sites More sharing options...
jdavidbakr Posted May 17, 2010 Share Posted May 17, 2010 Would it be better served to use .htaccess to password-protect the directory? That way you'd be allowing access regardless of the IP address. Other than having some sort of username/password setup, either in the Apache server or something you build in PHP, I'm not sure there's really a way to restrict access without knowing a user's IP address. Link to comment https://forums.phpfreaks.com/topic/202073-ip-whitelistaccess-list-help/#findComment-1059713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.