My PHP script stops suddenly without showing errors

时间:2018-03-25 21:11:26

标签: php

I'm making a script that does the same thing as weleakinfo.com: you enter an email and the script searches it in leaked databases.

I've uploaded all the txt files (named from 1.txt to 230.txt) and they are all the same: each file is in the format email:password.

At first, I used file() to read the lines in the files, but I got memory errors, so now I used fscanf() (I was told that way was a better one).

Now I get no errors but the script stops searching when around 40 seconds have passed.

I have set the max_execution_time to "infinite" (0), but it still stops working at 40 seconds of having started.

The code is the following, I don't find the error:

$email = $_POST["email"];

if ($email != '') {

      for ($i = 1; $i < 231; $i++) {                // a loop to open all the files
        $filename = $i.'.txt';
        $file = fopen($filename,'r');
        $combo = fscanf($file,"%[^'\n']");

        while($combo){
          $combo = (fscanf($file,"%[^'\n']"))[0];   // read a line (email:password)
          $comboemail = (explode(':',$combo))[0];   // read only the email
          if ($comboemail == $email) {     
            echo $combo.'<br/>';
            break 2;
          }
        }
        fclose($file);
        echo 'searched in file: '.$filename.'<br/>';
      }
    }

0 个答案:

没有答案