admin管理员组文章数量:1310012
Here's what I'd like to achieve:
- retrieve the GET value of its parameter from http://mysite/testing/?name=302Beep
- store it in a cookie
- redirect to http://mysite/dashboard
- display '302Beep' in http://mysite/dashboard page
With the help of this forum, I am able to store and redirect. But I don't know how to display it. Editted:
<?php
add_action('template_redirect', 'affiliate_redirect');
function affiliate_redirect() {
if( get_query_var('name') ) {
$tmpValue = get_query_var('name');
setcookie('tmpCookie', $tmpValue, time()+648000, '/');
$url = 'http://mysite/dashboard';
wp_safe_redirect($url);
echo $_COOKIE['tmpCookie'];
exit();
}
}
?>
Any advise is appreciated.
本文标签: pluginsDisplay value of the GET parameter in a new URL page
版权声明:本文标题:plugins - Display value of the GET parameter in a new URL page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741855658a2401325.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论