Jquery/Ajax Form Issues
Jquery/Ajax Form Issues
I'm not sure if this is a php issue or jquery issue. When I complete the form and hit submit it puts the successful message up like its supposed to but also with the fields still filled in the form which it shouldn't be doing and it doesn't actually post in the database so I'm not sure if its a php issue or jquery issue.
- <?php
// Include the database page
include ('inc/dbconfig.php');
if (isset($_POST['submittemplate'])) {
$templatename = mysql_real_escape_string($_POST['templatename']);
$headercode = $_POST['headercode'];
$footercode = $_POST['footercode'];
$query = "INSERT INTO `templates` (templatename, header, footer, creator_id, datecreated) VALUES ('$templatename','$headercode','$footercode', 1, NOW())";
mysqli_query($dbc,$query);
}
?>