我有一个包含变量的 URL,我希望该变量确定要重定向到的页面。我曾尝试在 Switch 语句中使用 Meta-redirect,但它不起作用。我做错了什么?
<?php
setcookie("affiliate", $_GET['a'], time()+31536000);
?>
<!DOCTYPE html>
<html>
<body>
<?php
switch($_GET['p'])
{
case"h":
echo "<meta http-equiv="refresh" content="1; url=website/">";
echo "redirecting in 1 second";
echo "if this page does not redirect <a href="website/">click here.</a>";
break;
case"w":
echo "<meta http-equiv="refresh" content="1; url=website/watches.html">";
echo "redirecting in 1 second";
echo "if this page does not redirect <a href="website/watches.html">click here.</a>";
break;
case"sf":
echo "<meta http-equiv="refresh" content="1; url=website/watches/solar-flare.html">";
echo "redirecting in 1 second";
echo "if this page does not redirect <a href="website/watches/solar-flare.html">click here.</a>";
break;
default:
echo "incorrect page option";
}
?>
</body>
</html>
谢谢 :)
克里斯