$_ server Http_referer yog dab tsi?
$_ server Http_referer yog dab tsi?

Video: $_ server Http_referer yog dab tsi?

Video: $_ server Http_referer yog dab tsi?
Video: How a DNS Server (Domain Name System) works. 2024, Kaum ib hlis
Anonim

Nqe lus piav ¶ $_SERVER yog ib qho array uas muaj cov ntaub ntawv xws li headers, paths, thiab tsab ntawv qhov chaw. Cov kev nkag hauv cov array no yog tsim los ntawm lub vev xaib server . Tsis muaj kev lees paub tias txhua lub vev xaib server yuav muab ib qho ntawm cov no; servers tej zaum yuav omit ib co, los yog muab rau lwm tus tsis tau teev nyob rau hauv no.

Ib yam li ntawd, kev siv $_ server Http_referer hauv PHP yog dab tsi?

Siv cov HTTP_REFERER sib txawv nrog PHP . Thaum lub vev xaib browser txav los ntawm ib lub vev xaib mus rau lwm qhov thiab nruab nrab ntawm nplooj ntawv ntawm lub vev xaib, nws tuaj yeem xaiv hla qhov URL nws los ntawm. Qhov no yog hu ua HTTP_REFERER , thiab tsab ntawv no saib yuav ua li cas siv qhov hloov pauv no nrog PHP.

Ib yam li ntawd, $ _ server Document_root yog dab tsi hauv PHP? $_SERVER [' DOCUMENT_ROOT '] yog cov npe ntawm cov ntawv tiag tiag, yog li yog tias koj tab tom khiav. yoursite.com/folder/script. php ib . $_SERVER [' DOCUMENT_ROOT '] yuav yog /folder/ tab sis yog tias koj siv backslash ua ntej cov ntaub ntawv xws li: / suav nrog / txuas. php ib.

Tsis tas li ntawd, $ _ server hloov pauv yog dab tsi?

$_SERVER yog PHP super global sib txawv uas tuav cov ntaub ntawv hais txog headers, paths, thiab tsab ntawv qhov chaw.

$_ server Php_self yog dab tsi?

Cov $_SERVER [" PHP_SELF "] yog qhov hloov pauv loj thoob ntiaj teb uas rov qab cov npe ntawm cov ntawv tam sim no. $_SERVER [" PHP_SELF "] xa cov ntaub ntawv xa mus rau nplooj ntawv nws tus kheej, tsis txhob dhia mus rau lwm nplooj ntawv. Txoj kev no, tus neeg siv yuav tau txais cov lus yuam kev ntawm tib nplooj ntawv raws li daim ntawv.

Pom zoo: