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(); } ?> 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/159963-solved-ip-redirect-help/#findComment-843755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.