I see what you're saying, I do run it from the "customers.php" file if it doesn't work from the "new_customer.php" include just to be sure, but I still just can't seem to get it to insert into the database. It's the oddest thing.
Technically, this should be working, right? Does the code look right?
Thanks again for all the help so far!
function createform() {
echo '<form action="'. $_SERVER['SCRIPT_NAME'] .'" method="POST">
<p>Name:<br />
<input type="text" name="name" id="name" />
</p>
<p>Email:<br />
<input type="text" name="email" id="email" />
</p>
<p>Phone:<br />
<input type="text" name="phone" id="phone" />
</p>
<p>Address:<br />
<textarea name="address" id="address" cols="45" rows="5"></textarea>
</p>
<p>Comments: <br />
<textarea name="comments" id="comments" cols="45" rows="5"></textarea>
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" />
<input type="reset" name="reset" id="reset" value="Reset" />
</p>
</form>';
}
$submit = $_POST['submit'];
if(isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$address = $_POST['address'];
$comments = $_POST['comments'];
mysql_query("INSERT INTO customers (name, email, phone, address, details) VALUES('$name', '$email', '$phone', '$address', '$comments') ") or die(mysql_error());
echo '<p class="success">Customer Added!</p>
<ul>
<li>Name: '. $name .'</li>
<li>Email: '. $email .'</li>
<li>Phone: '. $phone .'</li>
<li>Address: '. $address .'</li>
<li>Comments: '. $comments .'</li>
</ul>';
} else {
createform();
}