title: How to send ip from user to PDO/MSQLI in a login form
body: <p>I have a from that its working just perfect and I wanted to add some things i wanted to add the ip addres of user to the table of that user</p>
  
  <p>Example: </p>
  
  <pre><code>user123 id- 1 pass - qwuHs7AtcbjIn(encripted) ip_address - 127.0.0.0
  </code></pre>
  
  <p>I wanted it always when he logins to send hes current ip to the column ip_address</p>
  
  <p>Here's the code</p>
  
  <pre><code>&lt;?php
  
  require_once 'dbconfig.php';
  
  if($user-&gt;is_loggedin()!="")
  {
      $user-&gt;redirect('dash.php');
  }
  
  if(isset($_POST['btn-login']))
  {
      $uname = $_POST['txt_uname_email'];
      $umail = $_POST['txt_uname_email'];
      $upass = $_POST['txt_password'];
  
      if($user-&gt;login($uname,$umail,$upass,))
      {
          $user-&gt;redirect('dash.php');
      }
      else
      {
          $error = "Dados inválidos";
      }   
  }
  ?&gt;
  </code></pre>