Jump to content


This topic is now archived and is closed to further replies.


IP Ban and redirect an exact ip

Recommended Posts

i want to redirect an exact ip.... i want to redirect him to some other sites.. i used this code... tell me whats wrong...

$ipadd = $_SERVER['REMOTE_ADDR'];
if($ipadd == "") // This ip was banned in dnsstuff too...
$filename = 'textfile';
if (is_writable($filename)) {
  if (!$handle = fopen($filename, 'a')) {
      //  echo "Cannot open file ($filename)";

  // Write somecontent to our opened file.
  if (fwrite($handle, "Kicked") === FALSE) {
      // echo "Cannot write to file ($filename)";
////  echo "Success, wrote ($somecontent) to file ($filename)";

} else {
  //echo "The file $filename is not writable";
header("Location: http://google.com");

tell me your suggestions and ideas...

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.