T
T
topuserman2020-02-18 19:31:15
PHP
topuserman, 2020-02-18 19:31:15

Anomalous php behavior?

There is a certain site, for example:

when you try to use the get_headers or file_get_contents functions, you get the following anomaly:

$url = "https://domain.com/catalog/sales/";

var_dump(
    get_headers($path)
);


I make a request for a completely different resource, but I receive a response not from a remote server, but from my own! Those. if on my server (the site from which I am making a request) there is a /catalog/sales/ section, then the response is 200 OK. Same with file_get_contents($url); I make a request for a remote resource, I get the content of my site!

Roughly speaking, it feels like the domain for which I am making a request is being replaced by my domain!

This problem is only with some sites with https, perhaps related to the certificate? for sure some setting in php.ini ..

Plz tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jonh Doe, 2020-02-19
@CodeByZen

$url = "https://domain.com/catalog/sales/";

var_dump(
    get_headers($path)
);

Why are you defining a url and passing the path argument to the get_headers function? Apparently the problem is that you need to pass the url argument.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question