Reputation: 5
I want to go back to previous page after pressing "OK" on the function message prompted.
Php Code
function function_alert($message) {
// Display the alert box
echo "<script>alert('$message');
document.location='javascript://history.go(-1)';
</script>";
}
// Function call
function_alert("This email has already subscribed");
}
Thank you so much!
Upvotes: 0
Views: 822
Reputation: 1745
Tried this
function function_alert($message) {
echo "<script>
alert('$message')
history.back()
</script>";
}
Upvotes: 1