PHP重定向到URL变量

use*_*021 0 html php variables redirect

我正在尝试制作一个重定向页面,当您访问www.website.com/redirect.php?link=http://example.com时,您会在几秒钟内将浏览器重定向到example.com重定向免责声明.非常感谢您的帮助!

Pop*_*les 5

Javascript有效,但你不需要它,只需使用元刷新

<?php 

$url=$_GET['link'];

?>
<html>
    <head>
        <title>Rediercting</title>
        <meta http-equiv="refresh" content="10;URL='<?php echo $url; ?>'" />
    </head>
    <body>
        <p><a href="<?php echo $url; ?>">Redirecting to <?php echo $url; ?></a></p>
        <p>Some disclaimer</p>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)