admin管理员组文章数量:1310461
Given a certain url, custom = www.namesite/r=namerefferrer
to initialize a $_SESSION
and retrieve the value of this $_SESSION
I did:
I set this in functions.php:
if (!session_id()) {
session_start();
if($_GET['r']){
$_SESSION['referrer']=$_GET['r'];
}
}
in my front-page.php;
<?php
$rp = $_SESSION['referrer'];
echo $rp;
?>
but it does not recover anything unless I modify the url by adding a? after the /, like this:
www.namesite/?r=namerefferrer
how to recover the session and show it without ?
本文标签: sessionRetrieve parameter from url
版权声明:本文标题:session - Retrieve parameter from url 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741825318a2399606.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论