I have some problem regarding the attachments below:
newbook.php and insert_book.php seem to be can't "tolerate"
although i have tested it, but still the same problem out: which couldn't all the strings in newbook.php can seem to be POST to insert_book.php to print into my database. I have actually check for database :db_connect.php (its correct with no error).
**
Can somebody tell me, whats the problem occur?
newbook.php <html>
<head>
<title>book</title>
</head>
<body>
<h1>Books Result</h1>
<form action="insert_book.php" method="post">
<table border=0>
<tr>
<td>ISBN</td>
<td><input type="text" name="book_isbn" maxlength=13 size=13><br></td>
</tr>
<tr>
<td>Author</td>
<td> <input type="text" name="author" maxlength=30 size=30><br></td>
</tr>
<tr>
<td>Title</td>
<td> <input type="text" name="title" maxlength=60 size=30><br></td>
</tr>
<tr>
<td>Price $</td>
<td><input type="text" name="price" maxlength=7 size=7><br></td>
</tr>
<tr>
<td colspan=2><input type="submit" value="Register"></td>
</tr>
</table>
</form>
</body>
</html>
insert_book.php
<html>
<body>
<h1>Book Entry Results</h1>
<?php
require_once("db_connect.php");
if (!$book_isbn || !$author || !$title || !$price)
{
echo "You have not entered all the required details.<br>"
."Please go back and try again.";
exit;
}
$book_isbn =$POST['book_isbn'];
$author = $POST['author'];
$title = $POST['title'];
$price = $POST['price'];
$query = "insert into books values
('', '$book_isbn', '$author', '$title', '$price')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." book inserted into database.";
?>
</body>
</html>
I 'm sick of it
😕