Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $lines = file('ips.txt');
- $myproto = 'http';
- $mywebsiteurl = 'example';
- $endingstring = 'com';
- // you can use the 3 variables above(myproto, websiteurl, endingstring) in the exit message if you want. you can do {$myproto}://{$mywebsiteurl}.{$endingstring}
- // Loop through our array, show HTML source as HTML source; and line numbers too.
- foreach ($lines as $line_num => $line) {
- $visitorIP = $_SERVER['REMOTE_ADDR'];
- //DEV TEST: $visitorIP = '90.90.90.90';
- if($line==$visitorIP&&!empty($visitorIP)) {exit('IP Address is blacklisted/banned');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement