Answer the question
In order to leave comments, you need to log in
Is it possible to change the ip address in $_SERVER?
Hello. There is a certain script (API) to which it is possible to address from outside.
It is necessary to restrict access by IP. Option two. The first one is through the framework (Laravel, Request). The second is through htaccess.
In the first case, the data is taken from the $_SERVER superglobal array.
I would like to implement the first method.
Question: are these methods equivalent, is it possible to change the IP that comes in $_SERVER? Would htaccess be a more reliable way?
Answer the question
In order to leave comments, you need to log in
Question:Actually two...
Are these methods the same?almost equivalent
is it possible to change the IP that comes in $_SERVER? Would htaccess be a more reliable way?The IP address cannot be changed, but you can use a proxy, in which case the address of the real client will be replaced by the address of the proxy server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question