I am unable to pass the following form data:
<form method="post" action="form.php" id="contact" enctype="multipart/form-data">
<fieldset>
<legend>Contact Us</legend>
<div id="conleft">
<label>First Name:</label><input type="text" name="firstName" required />
<label>Last Name:</label><input type="text" name="lastName" required />
<label>House/Flat No:</label><input type="text" name="houseNum" />
<label>Address:</label><input type="text" name="address" />
<label>Town/City:</label> <input type="text" name="city" />
<label>Postcode:</label> <input type="text" name="postcode" />
<label>Telephone:</label> <input type="tel" name="telephone" />
<label>Email:</label> <input type="email" name="email" required />
</div>
<div id="conright">
<label>Enquiry:</label><textarea name="description" rows="13" required ></textarea>
<label>Date:</label><input type="month" name="date" /><br /><br />
<input type="submit" name="submit" value="Send" />
<input type="reset" name="Reset" value="Reset" />
<input type="hidden" name="customerNo" />
<input type="hidden" name="enquiryNo" />
<input type="radio" name="type" value="customer" checked />
</div>
</fieldset>
</form>
with the following PHP to MySQL database
<?php
$con=mysqli_connect("localhost", "root", "myuser","mypass");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql1="INSERT INTO customers (NULL, firstName, lastName, houseNum, address, city, postcode, telephone, email, type)
VALUES ('$_POST[customerNo]','$_POST[firstName]','$_POST[lastName]','$_POST[houseNum]','$_POST[address]','$_POST[city]','$_POST[telephone]', '$_POST[postcode]''$_POST[email]','$_POST[type]')";
mysqli_query($con,$sql1);
$sql2="INSERT INTO enquiry (NULL, customerNo, description, date)
VALUES ('$_POST[enquiryNo]','$_POST[customerNo]','$_POST[description]','$_POST[lastName]','$_POST[date]')";
mysqli_query($con,$sql2);
echo "<script language=javascript>window.location = 'thanks.html';</script>";
mysqli_close($con);
?>
The web page acts as if the form data has been sent by showing the thank.html page when submitted, but no data is populated in the database. I've set AUTO INCREMENT, PRIMARY and FOREIGN keys, is it the way I am trying to the pass the values?