Answer the question
In order to leave comments, you need to log in
Why is the get request executed correctly in the browser, but not from php?
Hello!
There is some URL that javascript on the site sends GET requests to. I want to execute the same request from php and get the same response as in the browser. But problems arise: the request either takes a long time to load or breaks altogether. A different response size (in bytes) is also returned. If you do the same from the console on the site (jQuery.get('...')), then the request is sent and the desired result is returned. With what it can be connected? How can I simulate a browser request to the server in php? Thank you!
Answer the question
In order to leave comments, you need to log in
I suspect that this URL is not accessible from the server. Try ssh in and ping the host. And look at the trace.
Where is the server? on the same domain? Cookies, authorization, other nuances... It's not clear from the question
the code of two lines
$some = file_get_contents('https://www.numismat.ru/bgimauctabs/43792a.zif');
var_dump($some);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question