Greetings!
I have here code that simply send input using mootols.js
here is my html code.
<html>
<head>
<title>Book Acquisition</title>
<script type="text/javascript" src="../js/mootools.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
$('registerForm').addEvent('submit', function(e) {
new Event(e).stop();
var log = $('log_res').empty().addClass('ajax-loading');
this.send({
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
});
});
});
</script>
<body>
<form id ="registerForm" action = "act1.php" method = "post">
<p><strong><label>Book Title:</label></strong><input type="text" name = "Title" placeholder = 'Title' required></p>
</form>
<div id="log">
<div id="log_res">
<!-- SPANNER -->
</div>
</div>
</body>
</html>
My problem is, I want to redirect when my validations is successful. I’m using my php code.
<?php include'../connection/connect-db.php';
$Title = $_POST['Title'];
if (empty($Titles)) {
echo 'title is empty';
}else {
sql queriess..
saving successful..
header("Location: Book_new2.php");
}
?>
My problem is when my validation is successful it doesn’t redirect to my header. Its not working.
Any help.