Redirection by value of $ _SERVER [ 'REMOTE_ADDR'] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Redirection by value of $ _SERVER [ 'REMOTE_ADDR'] (/showthread.php?tid=26920) |
Redirection by value of $ _SERVER [ 'REMOTE_ADDR'] - El Forum - 01-26-2010 [eluser]laegnur[/eluser] Another question of mine. How to do, that for the value of $_SERVER['REMOTE_ADDR'], if the IP is local, show content, and if the IP is external, redirect to another site? Redirection by value of $ _SERVER [ 'REMOTE_ADDR'] - El Forum - 01-26-2010 [eluser]bretticus[/eluser] You could probably use a regular expression of even a str* function, however, there are ways to do this to check if the remote ip is in the same range as your internal network. See this page Redirection by value of $ _SERVER [ 'REMOTE_ADDR'] - El Forum - 01-27-2010 [eluser]laegnur[/eluser] Hi! Thanks for you answer. With this article, and using his function, I was able to do so. Code: if(isSet($_SERVER['REMOTE_ADDR'])) |