Jump to content
Fórum Script Brasil
  • 0

Problema com cURL


leuuuuu

Question

Vou tentar ser o mais claro possível.

Possuo uma função em php utilizando cURL que busca imagens de 3 captchas diferentes.

No meu servidor local para testes (xampp) consigo receber as 3 imagens sem problemas, tudo funciona.

No servidor remoto, eu recebo duas das imagens, a terceira não tem como, já tentei de tudo.

function recebe_imagem($url, $arquivo, $cookiej="") {
                        $ch = curl_init ($url);
                        curl_setopt($ch, CURLOPT_HEADER, 0);
                        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
                        curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiej);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                        curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
                        $data=curl_exec($ch);
                        curl_close ($ch);
                        $fp = fopen($arquivo,'w');
                        fwrite($fp, $data);
                        fclose($fp);
                        return $arquivo;
                }

Se alguém puder me ajudar ficarei muito agradecido.

Obrigado!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652.1k
×
×
  • Create New...