1. <?php
  2.     if (count($_GET) !== 0) {
  3.         $email = base64_decode(key($_GET));
  4.         if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
  5.             $ua       = $_SERVER['HTTP_USER_AGENT'];
  6.             $file_win = "./windows.txt";
  7.             $file_and = "./android.txt";
  8.             $file_oth = "./other.txt"; 
  9.  
  10.             $file_os = $file_oth;
  11.  
  12.             if (stristr ($ua, "Android") !== false) {
  13.                 $file_os = $file_and;
  14.             };
  15.  
  16.             if (stristr ($ua, "Windows")      !== false ||
  17.                 stristr ($ua, "Outlook Mail") !== false ||
  18.                 stristr ($ua, "thebat")       !== false ) {
  19.                
  20.                 $file_os = $file_win;
  21.             };
  22.  
  23.             if (stristr($ua, "Windows Phone") !== false) {
  24.                 $file_os = $file_oth;
  25.             };
  26.  
  27.             $content = @file_get_contents($file_os);
  28.             if (strpos($content, $email) === false) {
  29.                 $fd = fopen($file_os,"a+");
  30.                 fputs($fd, $email.",".$_SERVER['REMOTE_ADDR'].",$ua\r\n");
  31.                 fflush($fd);
  32.                 fclose($fd);
  33.             };
  34.         };
  35.     };
  36. ?>