I tested it — it does work as expected, only two values showing IP address is written together, just remove one of the two equivalent PHP parts and/or add HTML markup:
<?php echo "<p>" . $_SERVER["REMOTE_ADDR"] . "</p>"; ?>
If shows the IP address of the user not the server. To show the server IP use
$_SERVER["REMOTE_ADDR"]
(
which is considered unsafe).
Now, the question is: why don't you see it? Check up:
- Are you sure you deployed this file to the site with HTTP server where PHP module is enabled?
- Are you sure the file name is "*.PHP"?
- Are you sure the service settings are tuned to process the files "*.PHP" through PHP?
I hope you understand PHP is the language which should be supported in server side? If you just open this file with some Web browser, PHP part won't be processed… :-)
—SA