title: How to delete data from html form php mysql
body: <p>I'm new to php and I learned some stuffs like adding data but I got stuck in deleting data from html form.
  Here's my code.</p>
  
  <p>database name: mydb</p>
  
  <p>tablename : registered</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;BODY&gt;
  &lt;form method="post" action="dataout.php"&gt;
  ID:&lt;input type="Text" id="idelete" name="idelete"&gt;&lt;br&gt;
  &lt;input type="Submit" name="submit" value="delete"&gt;
  &lt;/form&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>dataout.php</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  $db = mysqli_connect("localhost", "root","");
  mysqli_select_db($db,"mydb");
  $id=$_POST['idelete'];
  mysqli_query("DELETE FROM registered WHERE id=$id",$db);
  echo "Information Deleted";
  ?&gt;
  &lt;/body&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>When I click the button nothing appears, no errors and nothing;
  please help me.</p>