I'm having a problem inserting information into my database via forms...
Never had this problem before but it's suddenly cropped up when I switched webserver hosts.
When I try to insert information into my database via forms, the information either doesn't post (but no errors are returned) or blank fields are inserted into my database.
Here's my code for my form (newuser.php):
Code: Select all
<body bgcolor="white">
<FORM action="adduser.php" method="post">
Member Name: <input type="text" name="newname"><BR>
Member Status: <input type="text" name="newstatus"><BR>
<input type="submit" value="Add new Member">
</FORM>Now the code that takes the form information 'newname' and 'newstatus' and inserts them into the database (adduser.php)...
Code: Select all
<?
require ("connect.php");
$result = mysql_query ("INSERT INTO members (name, status)
VALUES ('$newname', '$newstatus')");
if(!$result)
{
echo "<b>Something not added:</b> ", mysql_error();
exit;
}
if($result)
{
mysql_close($db);
print "Something added sucessfully!";
}
?>