Advertisement
verrary

IP Filter From text Files

Nov 30th, 2014
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php //يقوم بقرائة ملف تكست يحتوي على  عناوين ايبي موضوعة بشكل عشوائي مختلطة مع نوض و ارقام و عرض كل ايبي في سطر لوحده
  2. $start = microtime(true);
  3. function excute(){global $start;$end = microtime(true);$time=number_format(($end - $start), 5);return$time;}ini_set('max_execution_time',6);
  4. echo' <a href="IpFilter.php">IpFilter File</a>';
  5. if (isset($_POST['Start']))
  6. {if (file_exists('BlockIP.txt'))
  7. {$IpRaw = file_get_contents('BlockIP.txt');
  8. $IpRaw = preg_replace("/[^0-9\/\n\.*|{\.\.}|\s+]/", '', $IpRaw);
  9. $IpRaw = preg_replace("..", '', $IpRaw);
  10. $IpList= array_map("rtrim", explode("\n", $IpRaw));
  11. } else {exit('Failed to open BlockIP.txt.');}
  12. echo  '<ol>';$j=$i=0;
  13. foreach ($IpList as $post)
  14. {$post=explode(" ", $post);
  15. echo ''.$post[0].'<br>';
  16.  $j=0;} $i++;$j++;}
  17. $i-=1;
  18. echo '</ol><br><b>'.$i.' Links on Page Loaded In '.excute().' Seconds<b/>';
  19. }
  20. ?>
  21. <form method='post' action="IpFilter.php">
  22. <input type='submit' value='Start' name='Start'/>
  23. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement