Echo Server Addr

0 Nikolai Illyich · September 11, 2015
This won't work, I have no idea why. Instead of 127.0.0.1, it just shows ::1





<html>
<?php
 $user_ip = $_SERVER['REMOTE_ADDR'];
 echo $user_ip;
?>
</html>




Anyone know why?

My sincerest thanks to you.

Post a Reply

Replies

Oldest  Newest  Rating
+1 jethro daniel · September 11, 2015
You are running on a localhost.. If your application was on a live server it would show!
0 Nikolai Illyich · September 11, 2015
Oh, I see. But how come on thenewboston's tutorials it showed 127.0.0.1? Is it because of php5?
+1 Renan Silva · September 11, 2015
In my computer shows ::1, but acessing with another host it shows correctly like: 10.0.0.15
0 Nikolai Illyich · September 12, 2015
I see now. Thanks for the clarification! :)
  • 1

PHP

107,257 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators