<!--
With this form I don't get an error when click on submit, but when I log onto my server to see if the info was submitted into my database its not showing up, please help:
-->
<?php
$email = $_POST['email'];
$persons_name = $_POST['name'];
$phone = $_POST['phone'];
$website_address = $_POST['websiteaddress'];
$query = "INSERT INTO free_estimate_c (email, name, phone, website_address )" .
"VALUES ('$email', '$persons_name', '$phone', '$website_address')";
$dbc = mysqli_connect('hostloacation', 'username, 'password', 'databasename')
or die('Error connecting to MySQL server.')
if ((empty($email))&&(empty($name))&&(empty($phone))&&(empty($website_address))){
echo "Fill in your information and we will contact you shortly";
?>
<form action="while_statement.php" method="post">
<label for="name">Name: </label><br />
<input type="text" id="name" size="60" name="name" value="<?php echo $persons_name; ?>" />
<br />
<br />
<label for="email">Email:</label><br />
<input type="text" id="email name="email" value="<?php echo $email; ?>" />
<br />
<br />
<label for="phone">Phone:</label><br />
<input type="text" id="phone" name="phone" value="<?php echo $phone; ?>" />
<br />
<br />
<label for="websiteaddress">Web Site Address:</label><br />
<input type="text" id="websiteaddress" name="websiteaddress" value="<?php echo $website_address; ?>" />
<br />
<br />
<input type="submit" value="submit" name="submit"/>
</form>
<?php
//closing first if statment
}
//if all fields are filled in insert form info into database
else if ((!empty($persons_name))&&(!empty($email))&&(!empty($phone))&&(!empty($website_address))){
mysqli_query ($dbc, $query);
}
?>