Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- ** Email filter.
- ** Coded by Constantine - 09/04/2015.
- ** Site: constantine.sourceforge.net
- ** php filter.php input.txt output.txt yahoo.com
- ** Greatz for L1sbeth and P0cl4bs Team. - https://github.com/P0cL4bs
- */
- error_reporting(0);
- if ($_SERVER['argc'] != 4)
- die("\n Use: php filter.php input.txt output.txt yahoo.com\n");
- $all = 0;
- $found = 0;
- $input = $_SERVER['argv'][1];
- $output = $_SERVER['argv'][2];
- $search = $_SERVER['argv'][3];
- if (check($input) == true && check($output) == true && check($search) == true )
- if (($p = fopen($input, 'r')) != null)
- {
- print "\n Starting...\n";
- while (!feof($p))
- {
- $all++;
- $email = fgets($p);
- $email = str_replace(array("\n", "\r"), '', $email);
- if (strstr($email, $search))
- if (($fp = fopen($output, 'a+')) != null)
- {
- $found++;
- fprintf($fp, $email ."\n");
- fclose($fp);
- }
- }
- print " Finished!\n\n";
- print " ". $all ." processed!\n";
- print " ". $found ." found!\n";
- fclose($p);
- }
- function check ($data)
- {
- if ($data)
- if (isset($data))
- if (!empty($data))
- if (strlen($data) > 0)
- if ($data != "")
- return true;
- return false;
- }
- /*
- ** EOF.
- */
- ?>
Advertisement