<?

$name = $_POST['name'];
$age = $_POST['age'];


// script to display all the records in a table

// connection information
$hostName = "servername";
$userName = "username";
$password = "password";
$dbName = "dbname";

// make connection to database
mysql_connect($hostName, $userName, $password) or die( "Unable to connect to host $hostName");

mysql_select_db($dbName) or die("Unable to select database $dbName");

// Insert Data into table1
$query = "INSERT INTO table1 (name, age) VALUES ('$name', '$age')";
$result = mysql_query($query);

// Close the database connection
mysql_close();

header("Location: home.htm");
?>