Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用$\u GET url变量重定向用户?_Url_Variables_Redirect_Get_Forward - Fatal编程技术网

如何使用$\u GET url变量重定向用户?

如何使用$\u GET url变量重定向用户?,url,variables,redirect,get,forward,Url,Variables,Redirect,Get,Forward,谢谢你抽出时间。我对PHP完全陌生,经验很少,因此非常感谢您的耐心和理解 我试图创建一个退出页面,我可以向我的用户显示5秒钟,然后将他们发送到第三方网站 我想在运行中执行此操作(例如exit.php?site=google.com) 我试过下面的代码,但似乎不起作用 <meta http-equiv="refresh" content="5; url="<?php echo 'http://www.' . htmlspecialchars($_GET["site"]) . '/';

谢谢你抽出时间。我对PHP完全陌生,经验很少,因此非常感谢您的耐心和理解

我试图创建一个退出页面,我可以向我的用户显示5秒钟,然后将他们发送到第三方网站

我想在运行中执行此操作(例如exit.php?site=google.com)

我试过下面的代码,但似乎不起作用

<meta http-equiv="refresh" content="5; url="<?php
echo 'http://www.' . htmlspecialchars($_GET["site"]) . '/';
?>"> 

您需要使用PHP代码

header("Location: http://www.example.com/"); 
很有可能。您可以尝试这样做:

$url = "refresh:5; url=http://www.".$_GET['site'];
header($url)

编辑:对不起,我忘了添加5秒等待时间。

刚刚添加了一种方法。我希望有帮助!谢谢,这很好用。如果你有PayPal帐户,我想给你一点捐款?我很感激你的提议,但没有必要,只是在这里帮助别人。