Discuz-X 全局G变量讲解之&nb…

全局基本变量

$_G['uid'] => 当前登录UID

$_G['username'] => 当前登录用户名

$_G['adminid'] => 当前登录ID管理组ID

$_G['groupid'] => 当前登录ID用户组ID

$_G['cookie'] => 客户端cookie

$_G['formhash'] => 当前登录ID的【FORMHASH】 主要用于表单提交

$_G['timestamp'] => 当前活动时间

$_G['starttime'] => 1317042440.3242

$_G['clientip'] => 当前访问者IP地址

$_G['referer'] => 当前请求的地址,主要用户表单提交

$_G['charset'] => 程序编码

$_G['PHP_SELF'] => 当前访问页面的相对地址

$_G['siteurl'] => 程序访问地址

$_G['siteroot'] => 程序所在域名的相对目录

$_G['fid'] => 当前版块id【主题列表页、帖子页】出现

$_G['tid'] => 当前帖子ID【帖子页】出现

$_G['basescript'] => 当前页面所在频道

$_G['basefilename'] => 当前页面php文件名

$_G['staticurl'] => 程序附件目录

$_G['mod'] => 当前页面的MOD值【例如:forum.php?mod=xxx】

$_G['inajax'] => 当前ajax请求的值【无-0 有-1】

$_G['page'] => 当前分页ID

$_G['tpp'] => 当前分页每页显示数量

$_G['seokeywords'] => 当前页面seo关键词

$_G['seodescription'] => 当前页面seo介绍

$_G['timenow'] => Array
(
      [time] => 2011-9-26 21:07 当前服务器时间
      [offset] => +8 当前服务器时区
)

$_G['config'] => Array
(
      $_G['config'][db] => Array
              (
                      $_G['config'][db][1] => Array
                              (
                                      $_G['config'][db][1][dbhost] => localhost 数据库连接地址
                                      $_G['config'][db][1][dbuser] => root 数据库用户名
                                      $_G['config'][db][1][dbpw] => 123456 数据库密码
                                      $_G['config'][db][1][dbcharset] => utf8 数据库编码
                                      $_G['config'][db][1][pconnect] => 0
                                      $_G['config'][db][1][dbname] => dxutf 数据库名
                                      $_G['config'][db][1][tablepre] => pre_ 数据表前缀
                              )
              )
)
原文链接:http://www.17kaifa.com/thread-35-1-1.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值