How do you redirect people based on IP addresses using PHP if they cannot enter a password and redirect people that are not banned straight to a home page?
Something like this: $ip = $_SERVER['REMOTE_ADDR']; $query = mysql_query("SELECT * FROM banned_ips WHERE ip = '$ip'"); if( mysql_num_rows($query) == 0 ) { header("Location: http://example.com/index.php"); } else { die("Sorry, you're banned!"); } PHP: You would have to have a table with banned IP's in them, of course. Hope that helps. - Bananasphere
or.. <?php //banned ips $bannedips = array("123.2334234.23", "34345.24354.34"); if(in_array($_SERVER['REMOTE_ADDR'], $bannedips)){ echo "Your banned"; } else { header("Location: http://example.com/index.php"); } ?> PHP: