Cov txheej txheem:

Kuv tuaj yeem paub kuv tus IP server li cas hauv PHP?
Kuv tuaj yeem paub kuv tus IP server li cas hauv PHP?

Video: Kuv tuaj yeem paub kuv tus IP server li cas hauv PHP?

Video: Kuv tuaj yeem paub kuv tus IP server li cas hauv PHP?
Video: Tus Neeg Ruam - R-Lin Thoj | New Song [ Official MV ] Nkauj Tawm Tshiab 2023 Hmong Song 2023 2024, Kaum ib hlis
Anonim

Yuav kom tau txais cov IP chaw nyob ntawm server ib tus tuaj yeem siv ['SERVER_ADDR'], nws rov qab los IP chaw nyob ntawm server nyob rau hauv tsab ntawv tam sim no yog executing. Lwm txoj hauv kev yog siv ['REMOTE_ADDR'] hauv $_ SERVER array.

Yog li, kuv yuav nrhiav tau qhov chaw nyob IP ntawm kuv lub server li cas?

Nrhiav koj lub vev xaib server tus IP chaw nyob

  1. Nkag mus rau hauv koj lub vaj huam sib luag tswj.
  2. Xaiv Web Hosting los ntawm Hosting & Domains ntawv qhia zaub mov.
  3. Koj yuav pom cov npe ntawm koj cov pob hosting. Nyem rau ntawm pob koj xav nrhiav tus neeg rau zaub mov IP chaw nyob ntawm.
  4. Lub Web Server IP chaw nyob yog tso tawm nyob rau sab saum toj ntawm nplooj ntawv Txheej txheem cej luam.

Kuj Paub, $_ server Http_host yog dab tsi? 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.

Tsis tas li ntawd, qhov chaw nyob server yog dab tsi?

Ib lub npe server txhais cov npe sau rau hauv IP chaw nyob . Piv txwv li, thaum koj ntaus hauv "www.microsoft.com," qhov kev thov raug xa mus rau Microsoft lub npe server uas rov qab IP chaw nyob ntawm Microsoft lub vev xaib. Txhua lub npe sau npe yuav tsum muaj tsawg kawg yog ob lub npe servers teev thaum sau npe.

$_ server ['Remote_addr '] yog dab tsi?

Lub variable nyob rau hauv lub $_SERVER array yog tsim los ntawm lub vev xaib server xws li apache thiab cov uas tuaj yeem siv hauv PHP. Hauv paus $_SERVER [' REMOTE_ADDR '] muab tus IP chaw nyob uas qhov kev thov raug xa mus rau lub vev xaib server.

Pom zoo: