Hello,
I created a simple form to capture info entered into textboxes. It is posted to a php script to write to a mysql database. The script connects to the database without error, but the only thing that gets entered into the database is the date that is declared on the php script page and the autoincrment id.
The form can be found at http://www.lvoaf.org/reg.html
Here is some code snippets:
<h1>New Member Sign Up</h1>
<form id="form1" name="form1" method="post" action="reg_members_php.php">
---------------------------------------------
php script
<html>
<head>
<title>LVOAF Registration Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body background="images/hg_background.jpg" text="#000000">
<?php
$host = 'localhost';
$user = 'correct';
$pass = 'password';
$myDB = 'lvoaforg_register';
// Connection to DB is either sucessful or dies
$connect = mysql_connect($host, $user, $pass) or die ("Could not connect to the server\n");
//insert string for first table
$today = date('M d Y');
$table_name = 'member_reg';
//create query string to insert data into table
$query = "INSERT INTO $table_name (today, fname, lname, address, city, state, zip, phone, email, year_grad, school_grad, played) VALUES ('$today', '$fname', '$lname', '$address', '$city', '$state', '$zip', '$phone', '$email', '$year_grad', '$school_grad', '$played')";
?>
<table width="80%" align="center">
<tr>
<td height="233" valign="top" bgcolor="#003399">
<p><img src="images/logo_med.jpg" width="750" height="250"></p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0099FF">
<p><br>
<br>
<?php
//Print statement to verify if connection and inserts were made
mysql_select_db($myDB);
if (mysql_query($query, $connect)){
print "Hello!!! $fname, your registration for Bethany's 2010 VBS High Seas Adventure was successful on $today!<br>";
print "We'll be seeing you at Bethany July 12th - 16th!!!<br><br>";
print "Thank you!!!<br><br>";
print "Darcy Bierer - Director of Children's Ministries";
} else {
print " $fname, your registration request failed to register!";
} mysql_close ($connect);
?>
</p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0099FF">
<p> </p>
<p>Form Data Entered On: <?php
//Print last name back to screen
print ("$today");
?>
</p>
<p>First Name: <?php
//Print last name back to screen
print ("$fname");
?>
</p>
<p>Last Name: <?php
//Print last name back to screen
print ("$lname");
?>
</p>
<p>Address: <?php
//Print last name back to screen
print ("$address");
?>
</p>
<p>City: <?php
//Print last name back to screen
print ("$city");
?>
</p>
<p>State: <?php
//Print last name back to screen
print ("$state");
?>
</p>
<p>Zip: <?php
//Print last name back to screen
print ("$zip");
?>
</p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
</body>
</html>