karthikeyan_coder Posted September 14, 2006 Share Posted September 14, 2006 i want to redirect an exact ip.... i want to redirect him to some other sites.. i used this code... tell me whats wrong...[code] $ipadd = $_SERVER['REMOTE_ADDR'];if($ipadd == "209.61.157.78") // This ip was banned in dnsstuff too... { $filename = 'textfile'; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { // echo "Cannot open file ($filename)"; exit; } // Write somecontent to our opened file. if (fwrite($handle, "Kicked") === FALSE) { // echo "Cannot write to file ($filename)"; exit; } //// echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle);} else { //echo "The file $filename is not writable";}header("Location: http://google.com");}[/code]tell me your suggestions and ideas... Quote Link to comment Share on other sites More sharing options...
karthikeyan_coder Posted September 14, 2006 Author Share Posted September 14, 2006 that code writes "Kicked" in txt file.. but it is not redirecting the user... do i need to replace header() with die() ? 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.