I am using a server that has MySQL v4.1 and my code is supposed to take data entered into an HTML for and insert it into a database. All that is happening though is that I am only having on field fill out and that is my person id which isn't retrieved from the form. Any ideas?! Here is the whole code(with php)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Form Output</title>
</head>
<body>
<?php include("header.php"); ?>
<?php
$con=mysql_connect ("localhost", "prince_Prince", "password");//not real password for security
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$name = mysql_real_escape_string($_POST["name"]);
$gender = mysql_real_escape_string($_POST["gender"]);
$email = mysql_real_escape_string($_POST["email"]);
$comments = mysql_real_escape_string($_POST["comments"]);
mysql_query("INSERT INTO `emails` (`Name`, `Gender`, `Email`, `Comments`) VALUES ('$name', '$gender', '$email', '$comments')");
mysql_close($con);
?>
<?php
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$age = $_REQUEST['age'];
$gender = $_REQUEST['gender'];
$comments = $_REQUEST['comments'];
$to = "ziggy6005@gmail.com";
$subject = "$subject";
$message = "$name $email $gender $comments";
mail($to,$subject,$message);
echo "Thank you $name. I have now received an email containing the following information: <br/>
Name: $name <br/>
Email: $email <br/>
Email Subject: $subject <br/>
Age: $age <br/>
Gender: $gender <br/>
Comments: $comments";
?>
<?php include ("footer.php"); ?>
</body>
</html>