views:

145

answers:

2

Is there any way to work an alert to run when I echo a META tag which is refreshing the page?

The goal is to have the page refresh and then the Alert loads.

Example of current line:

echo '<META HTTP-EQUIV="Refresh" Content="0"; URL="contact-test.php">';
+1  A: 

try to add parameter into your url while refreshing (refresh as redirect), and, if parameter exists, show alert?

or maybe just check referer

valya
+3  A: 

The web is stateless:

  • if you want to show the alert whenever the page loads, you should simply handle this event
  • if you want to show the alert only when the user reloads the page you should pass a parameter to tell javascript that the page has been reloaded and then show your message only when the parameter is set (you may use a cookie or better a get parameter)
collimarco