Buongiorno a tutti
sono alle prime esperienze con PHP, chiedo gentilmente aiuto.
Ho creato un semplice form HTML per inserire in un DB MySQL dei dati attraverso una pagina PHP. Nel mio DB 'school' ho creato la tabella 'student'

il codice HTML per il form è (Recordinsertform.html):

codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>Form Input Data</title>
</head>

<body>
<table border="1">
  <tr>
    <td align="center">Form Input Employees Data</td>
  </tr>
  <tr>
    <td>
      <table>
        <form method="post" action="Recordinsert.php">
        <tr>
          <td>ID</td>
          <td><input type="text" name="id" size="5">
          </td>
        </tr>
        <tr>
          <td>NAME</td>
          <td><input type="text" name="name" size="40">
          </td>
        </tr>
         <tr>
          <td>CLASS</td>
          <td><input type="text" name="class" size="5">
          </td>
        </tr>
        <tr>
          <td></td>
          <td align="right"><input type="submit" 
          name="submit" value="Sent"></td>
        </tr>
        </table>
      </td>
    </tr>
</table>
</body>
</html>
il codice PHP per scrivere i dati è (Recordinsert.php):

codice:
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("school", $con);

$sql="INSERT INTO student (id, name, class)
VALUES
('$_POST[id]','$_POST[name]','$_POST[class]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con)
?>
l'errore è il seguente: quando invio i dati, il browser (Safari) mi apre il codice della pagina php, lo visualizza a video e non scrive nulla in DB.

Qualcuno mi sa dire cosa sbaglio?
grazie in anticipo
RM