Jump to content

ip address not displaying


Sbosh

Recommended Posts

Good day everyone. My name is Sbosh am i am still a newbie in PHP as i am still a newbie in the group.

Can someone please explain to me why my computer won't display my ip address?

I have the following code:

<?php

$ip_address = $_SERVER['REMOTE_ADDR'];

echo $ip_address;
    

?>

But the output is always some dots and a 1 like so:  ::1

 

Link to comment
Share on other sites

3 hours ago, Sbosh said:

in order for it to display in the form of 127.0.0.etc.. what do i need to do?

Why do you feel the need to?

IPv6 is already here and gaining in usage.  Let's face it, there are only so many IPv4 Addresses and more devices coming on line every day. 

There will come a time when IPv4 will be is phased out.  Why would you want to deliberately future-fail your code by locking it into this older protocol?

 

There is no effective difference between "127.0.0.1" and "::1". 
It's the [loopback] address of the local machine and, once your Application goes out onto its real server, your Application will, most likely, never see it again, anyway. 

 

No real difference?

Well, some of us might have to go buy a new T-Shirt to replace the one with this message: 

Quote

There's no place like 127.0.0.1 ... 

😉

Regards, 
   Phill  W.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.