|
add.html
<html> <head>
</head>
<body>
<h2>Add Data
<form method="post" action="added.php">
Name: <input type="text" name="xname"><br>
Author: <input type="text" name="xauthor"><br>
Description: <textarea name="xdescription"></text><br>
Body Text: <textarea name="xbody"></text><br>
<input type="submit" name="add" value="SUBMIT">
</form>
</body>
</html>
added.php
<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF">
<?php
$connect = mysql_connect("localhost", "user name", "pass");
mysql_select_db("guruofse_db1", $connect);
if($add == "SUBMIT"){
$sql = "INSERT INTO content SET
Name='$xname',
Author='$xauthor',
Body='$xbody',
Description='$xdescription'";
if(mysql_query($sql))
{
echo "The information has been added to the database.";
}
else
{
echo "There was an error submitting the information.";
}
} // closing bracket for original IF statement
?>
</body>
</html>
have put user name & passwd
error message There was an error submitting the information.
Last edited by taj79 : 07-29-2004 at 01:35 AM.
|