Hi I wonder if someone can help me. I don't know what is wrong with my
php files but they don't seem to pass variables using the post method.
here is the source of the file with the entry form:
:::::::::::::::::::::::::::::::::::::::::::::::::::
<html>
<head>
<title> New member entry screen </title>
</head>
<body>
<center>New member entry screen</center>
<form action="insert_user.php" method="post">
<input type=text name=name maxlength=13 size=13>
<input type=text name=surname maxlength=13 size=13>
<input type=text name=email maxlength=13 size=13>
<input type=text name=section maxlength=13 size=13>
<input type=submit value="Register">
</form>
</body>
</html>
and here is the source of insert_user.php:
::::::::::::::::::::::::::::::::::::::::::
<hmtl>
<head>
<title>Add user to Library Database</title>
</head>
<body>
<center>Add user to Library
Database</center>
<?
if (!$name || !$surname || !$email ||
!$section)
{
echo "You have not completed all the fields.<br>"
."Please go back and try again.";
exit;
}
@ $db = mysql_pconnect ("localhost", "root", "pass");
if (!$db) {
echo "Sorry, could not connect to database";
exit;
}
mysql_select_db ("library");
$query ="insert into user values
('".NULL."','".$name."','".$surname."','".$email."','".$section."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows(). "Inserted into database";
?>
</body>
</html>
It all works except for the fact that no data is being passed... when I
remove the check for the variables the database is updated with null
fields...
I hope you can help, thanks for your time,
Daniel.
--
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php