Jump to content
php.lv forumi

Kaa var dabuut kompja lokaalo ip?


riky

Recommended Posts

Cik zinu uz php ir funkcija ip() vai getip() utt. bet taas sniedz infu tikai par servera, vai arii lietotaaja ruutera ip! Varbuut var apvienot JavaScript ar php un dabuut lokaalo ip. Mosh kaads zin kaa palaist backgroundaa "ipconfig" no cmd un nolasiit infu, bet peec tam paarmest to ip uz php taalaakai apstraadei.

Link to comment
Share on other sites

REMOTE_ADDR? X_FORWARDER_FOR?

16030[/snapback]

Hmm, bet vai tad tas spees apiet ruuteri? Diez vai, ja tam buus ugunssiena, vai arii es kljuudos?

Bet ja buutu JavaScripts, tad to laizh cauri peec lietotaaja pieprasiijuma, un ja tas iespeejams, tad Javascripts, jau veelaak kompii var dariit ko vien grib.

 

Ah, hmm., ir tak veel arii iespeeja kaut ko meeginaat ar VBscriptu, nav jau tas labaakais variants, bet meeginaat var!

Ir kaads, kas zin kaa ar to nolasiit no taas cmd.exe to infu, vai no kaut kurienes citur?

(Plz, nedusmojieties, ja par daudz prasu, taa kaa nezinu pashas taas scriptu funkcijas, sintaksi, bet galva ta straadaa, un uzrakstu visu jau pats, kaa gribeetu, tik nemaaku kodaa realizeet. Luudzu paliidziet.)

Link to comment
Share on other sites

$usrIP=(isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'').
(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']!='unknown'?' fwd '.$_SERVER['HTTP_X_FORWARDED_FOR']:'').
(isset($_SERVER['HTTP_CLIENT_IP'])?' client_ip '.$_SERVER['HTTP_CLIENT_IP']:'').
(isset($_SERVER['HTTP_VIA'])?' via '.$_SERVER['HTTP_VIA']:'');

Link to comment
Share on other sites

<?PHP

$usrIP=(isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'').

(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']!='unknown'?' fwd '.$_SERVER['HTTP_X_FORWARDED_FOR']:'').

(isset($_SERVER['HTTP_CLIENT_IP'])?' client_ip '.$_SERVER['HTTP_CLIENT_IP']:'').

(isset($_SERVER['HTTP_VIA'])?' via '.$_SERVER['HTTP_VIA']:'');

 

print $usrIP

 

?>

 

nop, shitais neder, tas paraada tikai aareejo redzamo ip, taa pat, kaa dc++ raada.

Piem man ir 80.233.250.200, bet taa ir tikai aareejaa, bet gribu lai paraada iisto, taa kaa man raadaas caur ipconfig t.i. 10.2.0.12, lokaalaa tiikla ieksheejaa ip adrese.

Link to comment
Share on other sites

nu rodas jautajums.. kapeec tev tas vajdziigs.

tjip, ja jau tev servers, caur kuru tu tiec pie neta, tad tu to lapu uz aaru nevari dabuut - tikai caur servaku.

un ja tu uzliec uz servaka savu lapu, tad ip radisies lokalaa tiikla. (taas pashas 10.0.2.2 un 10.0.2.*)

 

| ||

bet man ir tiesiibas, kaa vienmeer, kluudiities. :ph34r:

Link to comment
Share on other sites

×
×
  • Create New...