i have a HTML form and a PHP file to get the variables from teh form and insert them into a mySQL table:
The code!:
The HTML
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Straight to the point - Guest Book</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#999999">
<form Name="Add" action="add.php" method="post">
<p><b>Name</B></p>
<p><input name="name" type="text" Maxlength="25"></p>
<p><B>E-Mail</B></p>
<p><input name="mail" type="text" maxlength="25"></p>
<P><b>Website</b>(if Available)</P>
<p><input name="site" type="text" maxlength"25"></p>
<p><b>Post For GuestBook</b></p>
<p>
<textarea name="post" cols="30" rows="5" wrap="PHYSICAL"></textarea>
</p>
<p>
<input name="submit" type="submit" value="Submit">
</p>
<input name="status" type="text">
</form>
</body>
</html>
The PHP Form:[b]
Code: Select all
<?PHP
//connect to the DB
$Connect=mysql_connect(localhost,***,***);
//select DB
$DB=mysql_select_db(DB);
// insert in to adamgb table: Fields, ID NAME DATE MAIL SITE POST , values in field order, ID - auto incremented NAME, date(auto) MAIL, SITE, POST
$query="INSERT INTO `adamgb` (`id`, `name`, `date`, `mail`, `site`, `post`) VALUES ('', '$name', '', '$mail', '$site', '$post'); ";
mysql_query($query);
echo("Your Comments were Entered into the Straight To The Point GuestBook, thanx!!")
?>
i dont know were i am going wrong, can n e 1 please help!?
grately appreciated!!