Answer the question
In order to leave comments, you need to log in
Is it possible to change the value of $_SERVER['REMOTE_ADDR'] on a local php server?
I am making a website on which the content should adjust to the region from which the user comes. I define the region from $_SERVER['REMOTE_ADDR'] , is it possible to change the value of $_SERVER['REMOTE_ADDR'] when starting the local php server (php -S localhost:8000) to see how the site will be displayed to different users?
Answer the question
In order to leave comments, you need to log in
Hang an additional IP on the interface, move the web server there and refer to this address.
Or corny to stick $_SERVER['REMOTE_ADDR'] = 'any another ip'; somewhere before checking. $_SERVER is not write protected. Just don't forget to delete before committing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question