在任何开发语言中都会有一些自己的变量这些称系统变量或环境变量,有需要的朋友参考一下.
PHP环境变量主要有$GLOBALS[]、$_SERVER[]、$_GET[]、$_POST[]、$_COOKIE[]、$_FILES[]、$_ENV[]、$_REQUEST[]、$_SESSION[]。$_GET和$_POST主要针对FORM表单提交的数据,$_COOKIE和$_SESSION主要针对客户端游览器和服务器端会话数据。$_FILES主要针对文件上传时提交的数据,$_REQUEST主要针对提交表单中所有请求数组,包括$_GET、$_POST、$_COOKIE中的所有内容,你可以通过print_r函数分别输出$_REQUEST或者$_COOKIE等进行比较。
$_SERVER变量
$_SERVER['PHP_SELF']
#当前正在执行脚本的文件名,与 document root相关。在FORM表单中,如执行文件是本身,你可以在ACTION中使用
$_SERVER['QUERY_STRING']
#获取查询语句,即获取的是url串中’?'后面的值
$_SERVER['DOCUMENT_ROOT']
#当前运行脚本所在的文档根目录。在服务器配置文件中定义。
$_SERVER['HTTP_ACCEPT']
#当前请求的 Accept: 头部的内容。
$_SERVER['HTTP_ACCEPT_CHARSET']
#当前请求的 Accept-Charset: 头部的内容。例如:“iso-8859-1,*,utf-8”。
$_SERVER['HTTP_ACCEPT_ENCODING']
#当前请求的 Accept-Encoding: 头部的内容。例如:“gzip”。
$_SERVER['HTTP_ACCEPT_LANGUAGE']
#当前请求的 Accept-Language: 头部的内容。例如:“en”。
$_SERVER['HTTP_CONNECTION']
#当前请求的 Connection: 头部的内容。例如:“Keep-Alive”。
$_SERVER['HTTP_HOST']
#当前请求的 Host: 头部的内容。
$_SERVER['HTTP_REFERER']
#链接到当前页面的前一页面的 URL 地址。
$_SERVER['HTTP_USER_AGENT']
#当前请求的 User_Agent: 头部的内容。
$_SERVER['SERVER_NAME']
#当前运行的PHP程序所在服务器主机的名称。
$_SERVER['REQUEST_METHOD']
#访问页面时的请求方法,即GET、HEAD、POST、PUT。
$_SERVER['DOCUMENT_ROOT']
#当前运行的PHP程序所在的文档根目录。也就是PHP.INI文件中的定义。
$_SERVER['HTTP_REFERER']
#链接到当前页面的前一页面的URL地址。在页面跳转功能中非常有用。
$_SERVER['REMOTE_ADDR']
#正在浏览当前页面访问者的IP地址。
$_SERVER['REMOTE_HOST']
#正在浏览当前页面用户的主机名。
$_SERVER['REMOTE_PORT']
#正在游览的用户连接到服务器时所使用的端口。
$_SERVER['SCRIPT_FILENAME']
#当前执行脚本的绝对路径名。
$_SERVER['SERVER_PORT']
#服务器所使用的端口
$_SERVER['SCRIPT_NAME']
#包含当前脚本的路径。这在页面需要指向自己时非常有用。
$_SERVER['REQUEST_URI']
#访问此页面所需的URI。如“/index.html”。
$_SERVER['PHP_AUTH_USER']
#应用在HTTP用户登录认证功能中,这个变量是用户输入的用户名。
$_SERVER['PHP_AUTH_PW']
#应用在HTTP用户登录认证功能中,这个变量便是用户输入的密码。
$_SERVER['AUTH_TYPE']
#应用在HTTP用户登录认证功能中,这个变量便是认证的类型。
$_SERVER['SERVER_SOFTWARE']
#服务器标识的字串,在响应请求时的头部中给出。
系统常量
__FILE__ 当前PHP程序脚本的绝对路径及文件名称
__LINE__ 存储该常量所在的行号
__FUNCTION__ 存储该常量所在的函数名称
__CLASS__ 存储该常量所在的类的名称
PHP_VERSION 存储当前PHP的版本号,也可以通过PHPVERSION()函数获取。
PHP_OS 存储当前服务器的操作系统
波比源码 » php 中常用的环境系统变量
purchase levofloxacin sale levaquin pills
order avodart 0.5mg without prescription tamsulosin online order zofran 8mg generic
generic aldactone 25mg buy propecia online cheap fluconazole 200mg over the counter
order ampicillin pill cephalexin 125mg generic buy erythromycin 250mg online
order sildenafil 50mg pill buy nolvadex 20mg for sale buy robaxin generic
suhagra for sale online order suhagra 50mg pill buy estradiol
order lamotrigine 50mg sale order tretinoin cream sale buy retin cream online
buy tadalis generic buy avana 200mg generic voltaren 50mg uk
accutane 10mg brand purchase accutane sale brand azithromycin 250mg
buy indomethacin 50mg generic amoxicillin 250mg pills buy amoxicillin 500mg for sale
acheter tadalafil cialis en france sildenafil 50mg generique pas cher
prednisone 5mg without prescription cialis 2.5 mg viagra 100mg usa
isotretinoin pills cheap isotretinoin 20mg stromectol pill for humans
order modafinil online cheap Cialis non prescription acetazolamide drug
order doxycycline 200mg pills levitra 20mg usa order generic lasix 40mg
order altace 10mg for sale buy astelin 10 ml online cheap brand azelastine 10ml
buspar 5mg over the counter ditropan 2.5mg without prescription oxybutynin 5mg over the counter
hytrin online order cost terazosin 1mg azulfidine 500 mg for sale
alendronate usa buy alendronate 70mg pills pepcid 40mg price
order benicar 20mg online diamox 250mg without prescription order acetazolamide pill
buy tacrolimus 1mg generic order ursodiol 150mg generic urso 150mg uk
buy bupropion 150 mg for sale cheap quetiapine seroquel 50mg generic
molnupiravir 200 mg for sale cefdinir 300 mg pills generic prevacid 15mg
sertraline 50mg sale order generic escitalopram 20mg sildenafil medication
imuran 100 mcg uk generic protonix order viagra 100mg
buy cialis 40mg pill buy cialis 10mg pills viagra 100mg oral
cialis professional generic symmetrel cost amantadine
buy dapsone 100 mg buy perindopril online order aceon sale
buy generic provera cyproheptadine over the counter buy periactin generic
order isotretinoin 40mg pill prednisone online buy buy prednisone 10mg for sale
nootropil 800 mg generic sildenafil overnight shipping usa sildenafil online order
zithromax pills prednisolone 20mg drug gabapentin 800mg over the counter
furosemide 100mg brand cheap doxycycline 100mg order hydroxychloroquine 400mg
amlodipine 5mg uk amlodipine pills cialis tadalafil
cheap clozaril 50mg generic clozaril decadron generic
sildenafil 100mg cheap lisinopril 2.5mg brand cheap lisinopril 2.5mg
linezolid 600mg over the counter best gambling sites sports gambling
buy omeprazole 10mg cheap omeprazole 10mg free games poker online
where can i buy a research paper affordable term papers best slots to play online
buy triamcinolone 10mg online claritin over the counter buy desloratadine for sale
dapoxetine without prescription buy priligy sale order levothyroxine sale
cost xenical 60mg order diltiazem 180mg without prescription zovirax order online
cialis 20mg ca propranolol for sale order clopidogrel 75mg online cheap
zyloprim 300mg brand order rosuvastatin pill brand zetia 10mg
methotrexate canada order reglan 20mg for sale metoclopramide order
domperidone online order sumycin 250mg generic purchase flexeril for sale
buy losartan 25mg online cheap buy cozaar generic order topamax 100mg sale
imitrex 50mg tablet order generic levaquin 250mg order avodart 0.5mg sale
generic ranitidine generic meloxicam celecoxib tablet
casinos online slots free online casino real money no deposit
flomax 0.4mg without prescription aldactone medication brand spironolactone
purchase cialis without prescription order generic tadalafil 40mg cost ciprofloxacin 1000mg
brand metronidazole 400mg clavulanate oral cheap bactrim 960mg
order fluconazole 200mg pill viagra 100mg drug sildenafil women
order cialis generic real viagra pills sildenafil without prescription
cefuroxime for sale online purchase careprost online purchase methocarbamol pill
free slot machine games world poker online tadalafil pills
order desyrel sale cost sildenafil 50mg sildenafil 100mg ca
sildenafil 20mg estrace 1mg without prescription lamictal cost
prednisone 10mg cost buy accutane for sale buy amoxicillin generic
sildenafil without prescription buy sildenafil 100mg canadian cialis
order azithromycin 250mg gabapentin 600mg over the counter order gabapentin 600mg for sale
purchase furosemide sale purchase plaquenil for sale plaquenil 400mg usa
fildena us buy budesonide generic buy rhinocort pill
deltasone order online prazosin pill purchase mebendazole