Jump to content

Showing users IP address on site


srose

Recommended Posts

Hi

I am wanting to display users IP address on my site.  I typed this into a paragraph:

 

<p>
<?php
$user_ip = $SERVER['REMOTE_ADDR'];
print "Your I P Address is " . $user_ip;
?>
</p>

All this does is print "Your I P Address is", but it does not say the IP.

 

What is wrong here.

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/132593-showing-users-ip-address-on-site/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.