So the problem is that i made a form on inde1.php and by using javascript i post data to login.php.
What i am trying to accomplish right now is when the login.php is executed and everything is ok to redirect user to another page.
on inde1.php the js is like this:
$(document).ready(function() {
$("#myform").validate({
debug: false,
submitHandler: function(form) {
$.post('login.php', $("#myform").serialize(), function(data) {
checkFields(data);
if(data!="ok")
{
$("#myform")[0].reset();
grecaptcha.reset();
}
else
{
window.location.href = "pagetoredirect"
}
});
return false; // if default form submission was not blocked, add this.
}
});
});
I was wondering if i could skip this part:
else
{
window.location.href = "pagetoredirect"
}
and redirect users from login.php after login.php sends the "ok" to index1.php