D
D
D0UBL32020-05-29 14:36:11
PHP
D0UBL3, 2020-05-29 14:36:11

Why doesn't CURL work on automatic token generation?

Good evening everyone! Help, please, to understand a problem. cURL refuses to work. Worked earlier, now for the reason unknown to me returns the NULL answer.

$curl = curl_init();
curl_setopt($curl, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); 
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($curl, CURLOPT_TIMEOUT,30);
$page = curl_exec($curl);
echo var_dump($page);
echo curl_error($curl);
curl_close($curl);


The 'url' variable is present in the code earlier. Returns code 200 and a NULL array under any conditions. Previously worked flawlessly. If I specify any other site, or the main page of the site I need, everything works, but if I parse using a GET link, the response is NULL. The essence of the work of that site is that when searching on it - there is no GET link in the address bar, but I caught this link through the inspector. The site generates a token on a GET request, and then, already substituting a link into another GET, a response is issued in the form of JSON. This token is generated by my parser and substituted into the link, which is then used as an attribute. If you insert this link directly or follow it yourself, everything is fine, but when automatically generated, it does not work. Please help me figure out what is wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2020-05-29
@SilenceOfWinter

start the inspector on a new one, obviously) + try the proxy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question