mackiefan2004 Posted May 28, 2009 Share Posted May 28, 2009 I need a little help as to why this script errors at line 9: <?php // Get IP address $ips = explode('.', $_SERVER['HTTP_CLIENT_IP']); $bldg = $ips[2] // Redirect based on IP to correct building directory if ($bldg==34) { header( 'Location: http://127.0.0.1/adminapps/osh' ); exit(); } else { header( 'Location: http://127.0.0.1/adminapps/menu.html' ); exit(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/159963-solved-ip-redirect-help/ Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 $bldg = $ips[2] ^ forgot semi-colon at the end. Quote Link to comment https://forums.phpfreaks.com/topic/159963-solved-ip-redirect-help/#findComment-843746 Share on other sites More sharing options...
mackiefan2004 Posted May 28, 2009 Author Share Posted May 28, 2009 wow. i'm stupid. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/159963-solved-ip-redirect-help/#findComment-843748 Share on other sites More sharing options...
Maq Posted May 28, 2009 Share Posted May 28, 2009 wow. i'm stupid. thanks. mackiefan, for future reference surround your code with tags please. Also, if your topic is solved in the lower left hand side of the page there is a tab called "Topic Solved" you can click on. Quote Link to comment https://forums.phpfreaks.com/topic/159963-solved-ip-redirect-help/#findComment-843755 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.