Page 1 of 1
global variables in php
Posted: Fri May 27, 2005 2:45 pm
by andrei.mita
i want to make a hit counter that get as much info as it can from the viewer but in order to do so i need know all the var that i can get from the browser. where can i find a complet list of this variables. I know about $_SERVER, $_ENV and stuff but i don't know what to put between the ['']. can you please point me a url?
Posted: Fri May 27, 2005 2:52 pm
by hawleyjr
Try this:
Code: Select all
echo '<HR><PRE>'; print_r($_SERVER); echo '</PRE>';
Posted: Fri May 27, 2005 4:32 pm
by pickle
Look at the manual for SUPER GLOBALS.
Posted: Fri May 27, 2005 5:31 pm
by Roja
Already been discussed here:
viewtopic.php?t=33678&highlight=
Great sample code for *everything* you could want from the *client* (Thats why $_SERVER and SUPER GLOBALS aren't the best answer):
http://phpsniff.sourceforge.net/
Posted: Sat May 28, 2005 6:28 am
by andrei.mita
thanks again for the support.
Posted: Sat May 28, 2005 7:20 am
by andrei.mita
have another question. how can i see the hostname of the computer instead of the ip address. for instance, i have the 162.134.34.2 ip address but also the pc4-tcnet-barlad.rdslink.ro address (something like that). thank you.
Posted: Sat May 28, 2005 9:38 am
by Roja
andrei.mita wrote:have another question. how can i see the hostname of the computer instead of the ip address. for instance, i have the 162.134.34.2 ip address but also the pc4-tcnet-barlad.rdslink.ro address (something like that). thank you.
http://us2.php.net/manual/en/function.gethostbyaddr.php
Posted: Sat May 28, 2005 11:43 am
by andrei.mita
i thought that might be the function, now i know for sure. thanks