It seems that it is not advisable to use
<meta http-equiv=REFRESH CONTENT=3;url=url>
for redirects but instead use
header('Location: url')
However, I would like to show the user some message and allow them some time to read it before redirecting. Is there a way to do it without meta?
To redirect a webpage after 5 seconds, use the setInterval() method to set the time interval. Add the webpage in window. location. href object.
To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after. Through this, you can automatically redirect your visitors to a new homepage.
If you want to redirect a page automatically after a delay then you can use the setTimeout() method in JavaScript and it will call the above property after a time delay. The solution is very simple. The setTimeout() method will call a function or execute a piece of code after a time delay (in millisecond).
PHP 301 Redirect To set a permanent PHP redirect, you can use the status code 301. Because this code indicates an indefinite redirection, the browser automatically redirects the user using the old URL to the new page address.
Try use "refresh" header:
header('Refresh: 3;url=page.php');
Also, you can look at this Question Refresh HTTP Header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With