title: Adding IP address to my form
body: <p>I have this php code. </p>
  
  <pre><code>&lt;?php
        if (isset($_POST['name'], $_POST['post'])) {
               $cast = $_POST['cast'];
               $name = $_POST['name'];
               $email = $_POST['email'];
               $post = nl2br ($_POST['post']);
               $ipaddress = $_POST['ipaddress'];
  
  if (empty($name) or empty($post)) {
               $error = 'All Fields Are Required!';
  }else{
  $query = $pdo-&gt;prepare('INSERT INTO comments (cast, name, email, post, ipaddress) VALUES(?, ?, ?, ?, ?)');
       $query-&gt;bindValue(1, $cast);
       $query-&gt;bindValue(2, $name);
       $query-&gt;bindValue(3, $email);
       $query-&gt;bindValue(4, $post);
       $query-&gt;bindValue(5, $ipaddress);
  
       $query-&gt;execute();
  ?&gt;
  </code></pre>
  
  <p>And this form.</p>
  
  <pre><code>&lt;?php if (isset($error)) { ?&gt;
       &lt;small style="color:#aa0000;"&gt;&lt;?php echo $error; ?&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;?php } ?&gt;
  
  &lt;form action="episode.php?id=&lt;?php echo $data['cast_id']; ?&gt;" method="post" autocomplete="off" enctype="multipart/form-data"&gt;
  &lt;input type="text" name="name" placeholder="Name" /&gt; / &lt;input type="text" name="email" placeholder="Email" /&gt;&lt;small style="color:#aa0000;"&gt;*&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;textarea rows="10" cols="50" name="post" placeholder="Comment"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;input type="submit" value="Add Comment" /&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;small style="color:#aa0000;"&gt;* &lt;b&gt;Email will not be displayed publicly&lt;/b&gt;&lt;/small&gt;&lt;br /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>As you can see I have set up an IP address to be saved with this form in my database. </p>
  
  <p>How can I add the IP address in the form? But I do not want this to be displayed to my users. </p>
  
  <p>Is this possible?</p>
  
  <p>Thank you. </p>