Question: A blank page is returned when I try to add a new note. My code is in php and the DB is mysql

This is the php code:

```
if (isset($_POST['Submit'])) {
  $candidate_id = $_POST['candidate_id'];
  $Notes = $_POST['notes'];
  if ($Notes != "") {
    $sql3 = "INSERT INTO notes (notes_id, candidate_id, notes) VALUES(DEFAULT,'$candidate_id','$Notes')";
    $result3=mysql_query($sql3);
    if (!$result3) {
      die('Error: ' . mysql_error());
    }
    echo "</br>1 note added"
  }
}
mysql_close();

```

The code for the form

```
<div id="tab3">
  <h2> Notes </h2>
  <dl>
    <dt>Notes</dt>
    <dd>
      <textarea id="notes" style="width: 80%; height: 150px;" name="notes"></textarea>
    </dd>
  </dl>
  <?php
    echo "<a href =newCandidate.php?id=$contact_id><input style =\"right:2em; bottom:1em;\" type =\"button\" name =\"update\" value =\"Submit\"></a>";
  ?>
</div>

```

Answer: 
try

```
if($_SERVER['REQUEST_METHOD']=="POST"){

```

or

```
if(isset($_POST['update'])){

```

instead of

```
 if (isset($_POST['Submit'])) {

```

the name of the submit button is **update** not **Submit** on your form

also stop using mysql\_\* functions. If you have to use them for now, at least escape the inputs properly before inserting them to database.
in your submit button you have no form 

try this

```
      <div id ="tab3">
  <h2> Notes </h2>
 <dl><dt>Notes</dt><dd><form action="" method="post" name="myform"><textarea id="notes" style="width: 80%; height: 150px;" name="notes"></textarea></dd></dl>
      <?php   echo "<a href =newCandidate.php?id=$contact_id><input style =\"right:2em; bottom:1em;\" type =\"button\" name =\"update\" value =\"Submit\"></a></form>";
    ?>   </div>

```

* and please avoid using inner css , please use classes in other css file.