I've read somewhere that using a META refresh for a redirect, is not a recommended practice.
As far as I understand header( "refresh:0;url=$url" );
in PHP,
and <meta http-equiv="refresh" content="0;url=$url/" />
as a META tag in HTML,
are both considered a META refresh which would return this header:
HTTP/1.x 200 OK
...
Refresh: 0;url=$url
Assuming I don't want to use a JS redirect, would it be possible to use another recommended practice redirect such as 301 or 302, while still running the following elements in the redirect page, such as the following message and a certain script?
<?php
$url = "could-not-get-a-foo-parameter-at-all-error-monitoring-page.html";
if(isset($_POST['foo'])){
switch ($_POST['foo']) {
case "a":
$url = "http://www.aaa.com/";
break;
case "b":
$url = "http://www.bbb.com/";
break;
default:
$url = "foo-parameter-exists-but-is-wrong-error-monitoring-page.html";
break;
}
}
header( "refresh:0;url=$url" );
?>
<!doctype html>
<html>
<head>
<style>
.message {
color:blue;
}
</style>
</head>
<body>
<div class="message">Redirecting, Please hold on...</div>
<script>
something
</script>