Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $action = $_GET['action'] or die("F");
- $code = $_GET['code'] or die("F");
- $ip = $_GET['ip'] or die("F");
- if($code != md5("The Book is on the Table + $ip")){
- die("F");
- }
- $file="chat_ipsbloqueados.txt";
- if($action == "ban") {
- $open=fopen($file,"a") or die ("FF");
- fwrite($open,$ip."\r\n") or die("F");
- echo "T";
- } elseif($action == "rm") {
- $open = fopen($file, "r") or die("FF");
- $lines = explode("\r\n", fread($open, filesize($file)));
- $n = "";
- $find = false;
- for($i = 0; $i < count($lines); $i++){
- if($lines[$i] != $ip and !empty($lines[$i]) ) {
- $n .= $lines[$i]."\r\n";
- }elseif($lines[$i] == $ip) {
- $find = true;
- }
- }
- if($find == true) {
- fclose($open);
- $open = fopen($file, "w") or die("F");
- fwrite($open, $n) or die("F");
- echo "T";
- } else {
- echo "F";
- }
- }
- fclose($open);
- ?>
Add Comment
Please, Sign In to add comment