What is the best practice for passing parameters in meta http-equiv="refresh" in PHP scripts?
When passing parameters in meta http-equiv="refresh" in PHP scripts, it is best practice to use the header() function to send the HTTP header with the refresh meta tag. This ensures proper redirection and parameter passing without any issues.
<?php
// Set the URL and delay time for redirection
$url = 'new_page.php';
$delay = 5;
// Send the HTTP header with the refresh meta tag
header("refresh: $delay; url=$url");
// Output a message before redirection
echo 'Redirecting to the new page in 5 seconds...';
// You can also pass parameters in the URL like this:
// $url = 'new_page.php?param1=value1&param2=value2';
?>