Can anyone see why the form data is not getting to the database? I'm not getting any error messages, just a blank page. Thanks in advance for any help.
Here's the form:
<head>
<title>Sign Up New Participant</title>
</head>
<body>
/*This program registers a new Summer Reading Club participant and inserts the data into the SRC database.*/
This student has not yet registered for the Summer Reading Club. Please fill in the form below.";
?>
<form method="POST" action="add_record.php">
<table>
<tr><td>Last Name <input type = "text" name = "name_last" size = "20" /> </td></tr>
<tr><td>First Name <input type = "text" name = "name_first" size ="20" /></td></tr>
<tr><td>Age <input type = "text" name = "age" size = "5" /></td></tr>
<tr><td>Phone <input type = "text" name = "phone" size = "10" /></td></tr>
<tr><td>School<select name = "school">
<option value ="preschool">Preschool</option>
<option value ="JWR">JWR</option>
<option value ="lincoln">Lincoln</option>
<option value ="winter">Winter</option>
<option value ="homeschool">Homeschool</option>
<option value ="other">Other</option></td></tr>
<tr><td></td></tr><tr><td><input type ="submit" value="submit"></td></tr>
</table>
</form>
</body>
and here's the php
/*This script checks to see if the form has been submitted, and inserts the form data into the database*/
if (isset ($_POST['submit'])) {
include("books.inc"); //connect to the database
$query="INSERT INTO tblparticipant (pid, name_last, name_first, age, phone, school, signup_date)
VALUES (0, '{$_POST['name_last']}','{$_POST['name_first']}','{$_POST['age']}','{$_POST['phone']}','{$_POST['school']}',NOW())";
if (@mysql_query ($query)){
echo '<p>Great! The record has been added!</p>';
} else {
echo "<p>Cound not add the record because: <b>" . mysql_error() .
"</b>. The query was $query.</p>";
and here's the include file with connection info
<?php
$host="localhost";
$user="megan";
$password="mma";
$dbname="CRC";
$cxn=mysqli_connect($host,$user,$password,$dbname) or die ("Cannot connect to server.");