Diego,
Thanks for the help! Now having the opposite problem! Even if I have both fields populated, I get the error message of not having entered all the fields. I am totally confused, it just seems like it should be working, I've also attached the html below the php code:
<head>
<title>Book-O-Rama Book Entry Results</title>
</head>
<body>
<h1>Book-O-Rama Book Entry Results</h1>
<?
if (($testfield1 == "")|| ($testfield2 == ""));
{
echo "You have not entered all the required details.";
exit;
}
addslashes($testfield1);
addslashes($testfield2);
@ $db = mysql_pconnect("db.modwest.com", "root", "root");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
} mysql_select_db("book_sc");
$query = "insert into Test values ('".$testfield1."', '".$testfield2."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." book inserted into database.";
?>
</body>
HTML CODE *
<BODY>
<form action="insert_book.php" method="post">
<input type="text" name="testfield1" size="15"><BR><BR>
<input type="text" name="testfield2" size="15"><BR><BR>
<input type="submit" value="submit">
</form>
</BODY>