Why its not working...???


12/5/2018 1:41:00 PM

Viral Vaghela

6 Answers

New Answer


Mohamed ELomari its working fine on localhost... But not working on SoloLearn..


from http://php.net/manual/en/reserved.variables.server.php : "$_SERVER" is an array containing information such as headers, paths, and script locations. the entries in this array are created by the web server. " there is no guarantee that every web server will provide any of these, servers may omit some, or provide others not listed here. "


i try this: https://code.sololearn.com/w6BOt9tcWVtC/#php and founded that those keys you'd specifies were unset it.


Hamid what????




The three functions you have written, remote_addr etc. gives you the ip address of your server but this php compiler does not have any server, therefore this error is coming. If you placed same code on localhost or any other free online servers it will work.