Alert Message and Page Redirect Not Working Inside PHP

This page all about why alert message and page redirect not working inside PHP. Sometimes you have faced this kind of issue, Suppose for an example if someone submit the form and after data inserts in the database successfully then he wants to show the alert message. In that particular scenario If we echo some javascript inside the PHP script, then redirecting with PHP script like below example it will not work. So we need to change a line of code so that it will work fine in second example.

It Will won’t Work

Example-1:

Example-2:

Do This Way, it will Work for Sure:

 

Advertisements
Advertisements-1
Advertisements-2
Advertisements-3