linux1880 Posted July 31, 2008 Share Posted July 31, 2008 I want the simple php script which would determine if your IP address if 10.0.0.2 goto this url else go to this url How do I do that please help me. Thank you Quote Link to comment Share on other sites More sharing options...
samshel Posted July 31, 2008 Share Posted July 31, 2008 Google + php.net will give you all answers you need in this case.. <?php if($_SERVER['REMOTE_ADDR'] == "10.0.0.2") { header("Location: url1.php"); } else if($_SERVER['REMOTE_ADDR'] == "10.0.0.3") { header("Location: url2.php"); } //and so on... ?> Quote Link to comment Share on other sites More sharing options...
linux1880 Posted July 31, 2008 Author Share Posted July 31, 2008 Thank you sir, but it says Warning: Cannot modify header information - headers already sent by (output started at /home/beehix/WQ020065/htdocs/index.php:21) in /home/beehix/WQ020065/htdocs/index.php on line 5466 what I am getting this error ? Quote Link to comment Share on other sites More sharing options...
mbeals Posted July 31, 2008 Share Posted July 31, 2008 that block of code as to be the VERY first thing executed. So before anything else on the page (even whitespace), put that block 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.