Curl inside is time consuming and troubled

Asked

Viewed 58 times

0

I need to test all user accounts of a db on text area am utilizando the script

function informacoes(){
   $linhas = explode("\n", $_POST['conta']);
   $count = count($linhas) -1;

    for($i=0 ; $i<= $count; $i++) {
        $conta = explode("|", $linhas[$i]);

        $email = $conta[0];
        $senha = $conta[1];

        checker($email, $senha);
    }
}

Function Checker :

function checker ($email, $senha) {
  // todo o sistema do curlopt esta aqui
  // exemplo
  if(strpos($data, 'Erro":false') !== false){
      echo "conta ativa";
  }
}

The problema is that it stays muito lerdo and it doesn’t work as expected. Another problema it is also that only faz echo quando todas as contas já foram testadas

Analyze: case the text area has only 1 account the script is done as expected.

  • I didn’t understand very well, you want to check if the accounts are ok? Active? If you can give more details.

  • So, buddy, some accounts are active and some accounts are inactive. I want you to print out the answers.

  • This will be slow because it will test one account at a time if you still recreate the curl_init will have to do all the search for dns, https Handshake... One way maybe faster but more complex and using more resources is to use the curl_multi, on it you could process all at once, at least the requests can occur in parallel, of course could process in blocks.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.