ghurty Posted November 18, 2007 Share Posted November 18, 2007 Hi I have a php script that I only what to be executed if the visitor is from a paticular ip range (for example 192.168.5.*), what lines would I add to accomplish this? Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted November 18, 2007 Share Posted November 18, 2007 <?php if (!substr($_SERVER['REMOTE_ADDR'],0,9) == '192.168.5.')) { die(); } else { // rest of script. } ?> Be aware though that relying on an ip is a very unreliable way of tracking a user. 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.