php教程 全面获取url地址栏参数多种方法:
$_SERVER["SERVER_PORT"]//获取端口
$_SERVER[‘HTTP_HOST’]//获取域名或主机地址
$_SERVER[‘SERVER_NAME’]//获取域名或主机地php://input是什么意思?php输入流input的介绍址注:只是主域名 如xhxu.cn
$_SERVER["REQUEST_URI"]//获取域名后的详细地址 如:/index.php?id=123 …
$_SERVER[‘PHP_SELF’]//获取PHP文件名
$_SERVER["QUERY_STRING"]//获取PHP后的网址参数
$_SERVER[‘HTTP_REFERER’]//来源网页的详细地址
输出:
echo "rewrite: ".$_GET["rewrite"];
echo "<br>SERVER_PORT: ".$_SERVER["SERVER_PORT"];
echo "<br>HTTP_HOST: ".$_SERVER["HTTP_HOST"];
echo "<br>SERVER_NAME: ".$_SERVER["SERVER_NAME"];
echo "<br>REQUEST_URI: ".$_SERVER["REQUEST_URI"];
echo "<br>PHP_SELF: ".$_SERVER["PHP_SELF"];
echo "<br>QUERY_STRING: ".$_SERVER["QUERY_STRING"];
echo "<br>HTTP_REFERER: ".$_SERVER["HTTP_REFERER"];
注意:
PHP中的SERVER_NAME 和HTTP_HOST的区别
地址栏里输入以下网址:
1) 时
对应的值为:
HTTP_HOST: www.xhxu.cn
SERVER_NAME: xhxu.cn
2)
对应的值为:
HTTP_HOST: blog.xhxu.cn
SERVER_NAME: xhxu.cn
php $_SERVER 属性说明
$_SERVER[‘PHP_SELF’] #当前正在执行脚本的文件名,与 document root相关。
$_SERVER[‘argv’] #传递给该脚本的参数。
$_SERVER[‘argc’] #包含传递给程序的命令行参数的个数(如果运行在命令行模式)。
$_SERVER[‘GATEWAY_INTERFACE’] #服务器使用的 CGI 规范的版本。例如,“CGI/1.1”。
$_SERVER[‘SERVER_NAME’] #当前运行脚本所在服务器主机的名称。
$_SERVER[‘SERVER_SOFTWARE’] #服务器标识的字串,在响应请求时的头部中给出。
$_SERVER[‘SERVER_PROTOCOL’] #请求页面时通信协议的名称和版本。例如,“HTTP/1.0”。
$_SERVER[‘REQUEST_METHOD’] #访问页面时的请求方法。例如:“GET”、“HEAD”,“POST”,“PUT”。
$_SERVER[‘QUERY_STRING’] #查询(query)的字符串。
$_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[‘HTTPS’] — 如果通过https访问,则被设为一个非空的值(on),否则返回off
$_SERVER[‘REMOTE_ADDR’] #正在浏览当前页面用户的 IP 地址。
$_SERVER[‘REMOTE_HOST’] #正在浏览当前页面用户的主机名。
$_SERVER[‘REMOTE_PORT’] #用户连接到服务器时所使用的端口。
$_SERVER[‘SCRIPT_FILENAME’] #当前执行脚本的绝对路径名。
$_SERVER[‘SERVER_ADMIN’] #管理员信息
$_SERVER[‘SERVER_PORT’] #服务器所使用的端口
$_SERVER[‘SERVER_SIGNATURE’] #包含服务器版本和虚拟主机名的字符串。
$_SERVER[‘PATH_TRANSLATED’] #当前脚本所在文件系统(不是文档根目录)的基本路径。
$_SERVER[‘SCRIPT_NAME’] #包含当前脚本的路径。这在页面需要指向自己时非常有用。
$_SERVER[‘REQUEST_URI’] #访问此页面所需的 URI。例如,“/index.html”。
$_SERVER[‘PHP_AUTH_USER’] #当 PHP 运行在 Apache 模块方式下,并且正在使用 HTTP 认证功能,这个变量便是用户输入的用户名。
$_SERVER[‘PHP_AUTH_PW’] #当 PHP 运行在 Apache 模块方式下,并且正在使用 HTTP 认证功能,这个变量便是用户输入的密码。
$_SERVER[‘AUTH_TYPE’] #当 PHP 运行在 Apache 模块方式下,并且正在使用 HTTP 认证功能,这个变量便是认证的类型。
波比源码 » php全面获取网址url地址栏及各种参数
levofloxacin 250mg uk levaquin 250mg ca
order tadalafil 10mg online Discount viagra online viagra fast shipping
buspar 5mg generic order generic amiodarone ditropan without prescription
purchase molnupiravir pill prevacid 15mg uk lansoprazole 30mg ca
buy salbutamol pill genuine viagra viagra order
buy naltrexone for sale buy revia 50 mg pills order aripiprazole 30mg sale
provera price medroxyprogesterone price buy cyproheptadine 4 mg pills
cost of cialis levitra vs cialis sildenafil professional
lasix price buy furosemide 100mg without prescription plaquenil 200mg sale
order itraconazole 100mg online purchase prometrium without prescription tindamax 300mg us
viagra 100mg pill order sildenafil 100mg generic lisinopril 5mg without prescription
order linezolid 600 mg generic pala casino online casino slots
order xenical 60mg zovirax 400mg generic oral zovirax
ozobax cheap zanaflex canada toradol usa
ranitidine over the counter celebrex cost celecoxib uk
casino online gambling casino slots free poker online
buy ceftin pill order robaxin 500mg online cheap robaxin 500mg brand
buy tadalafil 20mg for sale diclofenac buy online indomethacin 75mg usa
purchase terbinafine sale cefixime 200mg oral trimox uk
order naproxen 250mg without prescription lansoprazole cheap buy prevacid 30mg sale
clarithromycin online buy catapres 0.1 mg pill generic antivert
pioglitazone 15mg over the counter viagra 50mg price sildenafil 50mg us
buy cialis 5mg pills Real cialis tadalafil 40mg usa
cialis 5 mg best online blackjack online blackjack for money
real money casino games best casinos free online poker games
adalat 10mg cost aceon 8mg us buy allegra 120mg generic
poker game online roulette game real money golden nugget online casino
golden nugget online casino real money poker online academicwriters
buy mesalamine 400mg for sale order generic astelin 10 ml avapro 150mg cost
benicar 10mg tablet order calan sale purchase divalproex without prescription
acetazolamide over the counter imuran cheap generic azathioprine
cheap amoxicillin stromectol 6mg us cost of ivermectin
priligy 60mg tablet buy domperidone generic order motilium pill
Thank you great posting about essential oil. Hello Administ . Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
Everything is very open and very clear explanation of issues. was truly information. Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
buy nortriptyline generic order paxil 20mg generic paxil 10mg drug
Thank you great post. Hello Administ . Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
Thank you great posting about essential oil. Hello Administ . Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
tadacip 10mg canada cheap trimox 250mg buy trimox 250mg without prescription
tricor 160mg cheap tricor for sale order sildenafil 100mg sale
order minocycline 50mg buy hytrin 1mg without prescription terazosin tablet
Thank you for great content. Hello Administ. Onwin , Onwin Giriş , Onwin Güncel Giriş , Onwin Yeni Adres , onwin
oral metformin 1000mg purchase glucophage online cheap buy nolvadex generic
stromectol tablets uk stromectol 6mg without prescription deltasone 20mg for sale
I really love to read such an excellent article. Helpful article. Hello Administ .
accutane generic buy amoxil generic zithromax online order
buy prednisolone 5mg generic gabapentin 800mg oral cost furosemide
order oxybutynin 5mg generic order generic prograf 1mg oxcarbazepine 300mg generic
cheap simvastatin 20mg sildalis tablet sildenafil 25mg for sale
purchase sildenafil sale viagra 50 mg rx pharmacy online cialis
uroxatral price trazodone 50mg canada diltiazem online buy
escitalopram generic prozac 20mg usa order naltrexone 50mg sale
canadian cialis and healthcare cheap tadalafil sale best otc ed pills
order clomid online buy vardenafil 10mg without prescription plaquenil 400mg without prescription
doxycycline pill buy amoxiclav buy augmentin 1000mg without prescription
levothyroxine for sale online order levoxyl for sale buy vardenafil cheap
albenza online aripiprazole uk medroxyprogesterone 5mg usa
biltricide without prescription oral cyproheptadine periactin cheap
order prinivil generic buy generic omeprazole for sale where to buy lopressor without a prescription
order tetracycline 500mg sale buy flexeril pill baclofen 25mg sale
brand plavix order plavix 150mg generic nizoral online buy
buy generic avanafil 200mg voltaren generic where can i buy diclofenac
catapres 0.1mg generic catapres where to buy buy tiotropium bromide pills
order minocycline pills order terazosin sale actos 30mg without prescription
accutane 40mg cost buy amoxicillin pills for sale buy zithromax 500mg pill
leflunomide 20mg generic buy sulfasalazine pills for sale azulfidine 500 mg canada
purchase furosemide online cheap buy monodox pill order albuterol for sale
Thank you for great information. Hello Administ . Onwin , Onwin Giriş , Onwin Güncel Giriş , Tiklayin. Onwin
purchase levitra for sale buy plaquenil sale brand plaquenil 400mg
Thank you for content. Area rugs and online home decor store. Hello Administ . Onwin , Onwin Giriş , Onwin Güncel Giriş , Tiklayin. Onwin
buy asacol 400mg for sale order avapro 300mg online cheap avapro 150mg pill
carvedilol 25mg us buy generic cenforce online buy cheap aralen
buy baricitinib 4mg online buy atorvastatin 10mg generic buy atorvastatin 20mg without prescription
cheap norvasc 5mg order generic omeprazole 20mg omeprazole drug
order adalat pill order perindopril online cheap purchase allegra sale
lopressor brand oral tenormin 100mg methylprednisolone 4mg over the counter
purchase sumycin pill purchase baclofen generic buy baclofen online cheap
erythromycin for sale online buy nolvadex 20mg online cheap buy tamoxifen 10mg online cheap
methocarbamol medication sildenafil 100mg ca suhagra 50mg tablet
cheap aurogra 100mg order sildenafil 100mg generic buy estradiol generic
order lamotrigine generic purchase lamotrigine generic purchase minipress sale
tretinoin drug order retin gel without prescription avanafil 100mg pills
buy tadacip 20mg online cheap brand voltaren order generic indocin 75mg
order arimidex without prescription buy arimidex 1mg generic buy catapres generic
meclizine buy online tiotropium bromide 9 mcg over the counter purchase minomycin pill
azathioprine ca imuran 50mg for sale order micardis 80mg
erection pills online viagra next day delivery usa sildenafil brand
best ed pills buy viagra 100mg for sale tadalafil 5mg pill
Thank you great posting about essential oil. Hello Administ . 儿童色情片
fexofenadine medication buy fexofenadine 120mg pills purchase amaryl online cheap
hytrin 5mg without prescription order hytrin without prescription order tadalafil generic
buy cordarone generic cordarone over the counter order dilantin sale
brand avapro brand clobetasol order buspar
how to buy ditropan buy amitriptyline cheap buy generic alendronate online
nitrofurantoin 100 mg cheap generic ibuprofen buy generic nortriptyline for sale
order paracetamol 500mg pills buy generic paxil over the counter order pepcid without prescription
clomipramine buy online generic itraconazole progesterone 100mg us
buy tacrolimus 5mg for sale purchase remeron online ropinirole 2mg oral
buy rocaltrol 0.25 mg generic buy calcitriol without prescription fenofibrate 200mg usa
oxcarbazepine 600mg brand order trileptal online ursodiol buy online
buy bupropion online cheap brand bupropion buy strattera 25mg pills
buy generic quetiapine online oral quetiapine 50mg brand escitalopram 20mg
buy ciplox 500 mg pill order duricef 500mg online cheap buy duricef no prescription
fluoxetine medication buy naltrexone 50 mg without prescription femara 2.5mg without prescription
lamivudine order where to buy accupril without a prescription purchase quinapril generic