I'm using:
*connection details*
$fname = stripslashes($_POST['fname']);
$surname = stripslashes($_POST['surname']);
$address = stripslashes($_POST['address']);
$sql = "INSERT INTO mytable (id, fname, surname, address)
VALUES ('', '$fname', '$surname', '$address')";
$results = mysql_query($sql);
if ($results)
{
echo "Details added.";
}
the problem is an entry is added to the table but all the data is blank instead of the stuff from the form?
Form:
<form id="myform" action="add.php" method="post" name="myform">
<label for="fname">First Name</label>
<input id="fname" name="fname" ><br />
<label for="surname">Surname</label>
<input id="surname" name="surname" ><br />
<label for="address">Address</label>
<input id="address" name="address" >
<input type="submit" name="submitButtonName" value="Add">