如何修复字符串请求/获取功能

时间:2019-02-06 23:58:02

标签: php

我正在尝试提取url字符串项(utm字段),将它们组合成一个变量(vtid)并传递到页面,但它仅传递破折号,而url信息未传递。

<?

$utm_source   = $_REQUEST['utm_source'];
$utm_medium   = $_REQUEST['utm_medium'];
$utm_campaign = $_REQUEST['utm_campaign'];
$utm_term     = $_REQUEST['utm_term'];
$utm_content  = $_REQUEST['utm_content'];

$vtid = $utm_source . "-" . $utm_medium . "-" . $utm_campaign . "-" . $utm_term . "-" . $utm_content;

?>

print_r($_REQUEST);显示

Array ( 
    [gr_subscriber] => exists 
    [email] => myemail@me.com 
    [http_referer] => example.com=&utm_source=as&utm_medium=ms&utm_campai… 
    [webforms_id] => 657433 
    [name] => Friend 
)

0 个答案:

没有答案