0

I have a function that loads a page and add a new user.

I want to show an alert(); and redirect/load a different function to change the url.

I have used

<meta http-equiv="refresh" content="0;page.php"></meta>
<script>
  alert("Pergunta eliminada com sucesso juntamente com as respostas!");
</script

Thank you!

2 Answers2

1

use the window.location.href property to set the URL you want to redirect to:

window.location.href = "http://path.to.url/";

Kevin L.
  • 1,371
  • 11
  • 24
1
echo '<script type="text/javascript">
                location.replace("profile/profile.php");
              </script>';

you can use the above one to replace a file using js in php and can even add an alert here

Killer
  • 47
  • 3