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
PHP如何传递URL参数以创建新URL_Php_Url - Fatal编程技术网

PHP如何传递URL参数以创建新URL

PHP如何传递URL参数以创建新URL,php,url,Php,Url,非常新的问题:建立一个Meraki wireless EXCAP围墙花园,让用户登陆到terms-of-service.php(简单复选框)。。。提交后,将与其他信息,然后需要传递到打开网站的页面上的土地。需要抓取第一个URL,保存它,传递到page2.php,然后发送到web Meraki的传入URL示例(当用户尝试访问无线时): 然后“当您准备授予用户访问权限时,将用户发送到GET['base\u grant\u url']+”?continue\u url=“+GET['user\u co

非常新的问题:建立一个Meraki wireless EXCAP围墙花园,让用户登陆到terms-of-service.php(简单复选框)。。。提交后,将与其他信息,然后需要传递到打开网站的页面上的土地。需要抓取第一个URL,保存它,传递到page2.php,然后发送到web

Meraki的传入URL示例(当用户尝试访问无线时):

然后“当您准备授予用户访问权限时,将用户发送到
GET['base\u grant\u url']+”?continue\u url=“+GET['user\u continue\u url']
。在上述示例中,此url为:

https://example.meraki.com/splash/grant?continue_url=http://www.google.com 
$_GET['base_grant_url']."?".$_GET['user_continue_url'];
在如何进行此操作的问题上,如果您有任何建议,我们将不胜感激。

请使用正确的值编码:

'http://MyCompany.com/MerakiSplashPage/?base_grant_url='.rawurlencode('https://example.meraki.com/splash/grant&user_continue_url=http://www.google.com').'&node_id=222222&gateway_id=222222&client_ip=10.222.222.222'
您还可以使用自动生成查询:

$query = array(
    'base_grant_url' => 'https://example.meraki.com/splash/grant&user_continue_url=http://www.google.com',
    'node_id' => '222222',
    'gateway_id' => '222222',
    'client_ip' => '10.222.222.222'
);
'http://MyCompany.com/MerakiSplashPage/?'.http_build_query($query)

您的最终URL为:

https://example.meraki.com/splash/grant?continue_url=http://www.google.com 
$_GET['base_grant_url']."?".$_GET['user_continue_url'];

那么,你在写什么页面呢?如果你能更清楚地了解用户将要浏览的一系列页面以及你需要帮助的页面的话。谢谢Gumbo&Babiker,我尝试使用parse_url,但没有成功。我会尝试这些…谢谢!