Discuz!中调用cookie的思路出来了:
    设置cookie:dsetcookie('cookie名', 'cookie值', '有效时间');

读取cookie有两种方法,第一种使用getcookie函数:
    getcookie('cookie名');
    第二种直接访问全局变量$_G:
    $_G['cookie']['cookie名']

例子:

<!--{if xxxx}-->
<!--{eval dsetcookie('type', '1', '86400');}-->
<!--{elseif xxxxx}-->
<!--{eval dsetcookie('type', '2', '86400');}-->
<!--{/if}-->

 

wordpress 调用cookie:

<?php
if (xxxx ) {
$_COOKIE['type'] = '1';
}else if (xxx) {
$_COOKIE['type'] = '2';
}
?>

页面中可用原生PHP语法和原生js

 

相关文章:

  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-06-22
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案