I'm having problems sending data to mysql through a php form.
Here is my form(info.php):
<form action="send.php" class="form-horizontal" method="post" name="application">
<div class="col-md-6">
<select class="form-control" name="title">
<option>Please select </option>
<option>Mr</option>
<option>Mrs</option>
<option>Miss</option>
<option>Ms</option>
</select><br>
<input type="text" class="form-control" placeholder="First name" name="first_name"><br>
<input type="text" class="form-control" placeholder="Surname" name="surname"><br>
Date of birth: <input type ="date" name="dob" class="form-control"><hr>
<h3>Address</h3>
<input type="text" class="form-control" placeholder="House name/ House number" name="house"><br>
<input type="text" class="form-control" placeholder="Street Name" name="street"><br>
<input type="text" class="form-control" placeholder="Town" name="town"><br>
<input type="text" class="form-control" placeholder="Postcode" name="postcode"><br>
<hr></div>
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Country of birth" name="origin"><br>
<input type="text" class="form-control" placeholder="Mobile/Phone number" name="number">
<input type="text" class="form-control" placeholder="Email address" name="email"><br>
<input type="hidden" name="plan" value="<? $plan; ?>">
<input type="submit" class="btn btn-success btn-lg" value="Submit application">
<hr>
</form>
Here is send.php:
<?php
$host="localhost"; // Host name
$username="******"; // Mysql username
$password="******"; // Mysql password
$db_name="*****"; // Database name
$tbl_name="*****"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form
$title=$_POST['title'];
$first_name=$_POST['first_name'];
$surname=$_POST['surname'];
$dob=$_POST["dob'];
$house=$_POST["house'];
$street=$_POST["street'];
$town=$_POST["town'];
$postcode=$_POST["postcode'];
$origin=$_POST["origin'];
$number=$_POST["number'];
$email=$_POST["email'];
$plan=$_POST["plan'];
// Insert data into mysql
$sql="INSERT INTO $tbl_name(' ',title, first_name, surname, dob, house, street, town, postcode, origin, number, email, plan)VALUES(' ','$title', '$first_name', '$surname', '$dob', '$house', '$street', '$town', '$postcode', '$origin', '$number',
'$email', '$plan')";
$sql=mysql_real_escape_string($sql);
$result=mysql_query($sql);
// if successfully insert data into database, displays message "Successful".
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='insert.php'>Back to main page</a>";
}
else {
echo "ERROR";
}
?>
<?php
// close connection
mysql_close();
?>
When I submit the form to send.php the page goes blank. Does this mean there is something wrong with my database auth?
Thanks in advance.