title: Getting IP address with PHP to display correctly
body: <p>I am trying to use the time and <strong>IP</strong> address to generate unique ID for users as they register for the site. The DB I'm using is <code>MySQL</code> and it comes with auto increment, but it doesn't seem like a practical technique for this. I am having issues with <code>$_SERVER['REMOTE_ADDR']</code> returning an unreadable address. I'm getting symbols for the value in the firebug console. I tried using <code>inet_ntop</code> and <code>inet_pton</code>, neither worked.</p>
  
  <pre><code>$ip_address = $_SERVER['REMOTE_ADDR'];
  $test = inet_ntop($ip_address);
  echo($test);
  </code></pre>
  
  <p>Why am I getting symbols instead of readable text?</p>
  
  <p>EDIT:</p>
  
  <p>What I want to store is a combination of the IP and time. I need the IP to show in format of "79.104.97.105" -Niet the Dark Absol, but what I'm getting is ��������������� if I use use inet_ntop or inet_pton or ::1 if I use just $_SERVER['REMOTE_ADDR'].</p>
  
  <p>Two part question: 1) Am I getting the IP address as IPv6 if it returns ::1, 2) How do I convert to 127.0.0.1 which I think is IPv4</p>