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!
Advertisement
Answer
Tried this
function function_alert($message) { echo "<script> alert('$message') history.back() </script>"; }