Jump to content

php ip ban


dezkit

Recommended Posts

how do i put the ipaddress of the person in the comment, where it says (ip)

 

<?php
$banned_ip = array();
$banned_ip[] = 'xx.xxx.xx.xxx';
foreach($banned_ip as $banned) { 
    $ip = $_SERVER['REMOTE_ADDR'];
    if($ip == $banned){ 
        echo "<br><br><br><br><br><br><br><br><center><font size='+2'>You have been banned from this site.</font><br>For further information about your ban, please email us at [email protected] and remember to include your IP Address<br><br>Your IP Address is (ip)";
        exit(); 
    } 
} 
?> 

Link to comment
https://forums.phpfreaks.com/topic/98055-php-ip-ban/
Share on other sites

Archived

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

×
×
  • Create New...

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.