title: How to Post some datas into mySQL server
body: <p>I am trying to get some informations from users such as name midterm final grades and post them into database which I am using the MySQL server.
  The problem is when I press the Add to DD button nothing changes and the data does not go into my table in database.</p>
  
  <p>here is my main code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body&gt;
  
   &lt;table border ="1"&gt;
    &lt;tr&gt;
    &lt;td&gt;Name&lt;/td&gt;
    &lt;td&gt;&lt;input id="name"&gt; &lt;/input&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Midterm&lt;/td&gt;
    &lt;td&gt; &lt;input id="midterm"&gt; &lt;/input&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Final&lt;/td&gt;
    &lt;td&gt; &lt;input id="final"&gt; &lt;/input&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Grade&lt;/td&gt;
    &lt;td&gt; &lt;input id="grade"&gt; &lt;/input&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;td&gt;&lt;input type="button" onclick="calculate()" value="Calculate"&gt;&lt;/td&gt;
    &lt;td&gt;  &lt;input type="submit"  value="Add to DB"&gt; &lt;/td&gt;
    &lt;/tr&gt;
   &lt;/table&gt;
  &lt;/body&gt;
  
  &lt;script type="text/javascript"&gt;
   function calculate(){
    var mid=document.getElementById('midterm').value;
    var fin=document.getElementById('final').value;
    var grade=mid*(0.3)+fin*(0.7);
    document.getElementById('grade').value=grade;
   }
   
  
  &lt;/script&gt;
  
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and this is also the code that inserts datas :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body&gt;
   &lt;form method="get" action="grade.php"&gt;
    &lt;input type="text" value="Welcome to Student Grades Calculator"&gt;
    &lt;br&gt;
    &lt;input type="submit" value="GO"&gt;
   &lt;/form&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  &lt;?php
  
   $name=$_POST['name'];
   $midterm=$_POST['midterm'];
   $final=$_POST['final'];
   $grade=$_POST['grade'];
   echo 'Hey';
   
   $connect= mysql_connect('localhost','root','','test');
   
   if(mysqli_connect_errno())
   {
     echo "Failed to connect to MySQL:".mysql_connect_errno();;
   }
   
   $s = "INSERT INTO(name,midterm,final,grade) VALUES('rr','33','33','33')";
   $sql = "INSERT INTO(name,midterm,final,grade) VALUES ('$name','$midterm','$final','$grade')";
   mysqli_query($connect , $sql);
   
   mysqli_close($connect);
   
   ?&gt;
   </code></pre>
  </div>
  </div>
  </p>