global variables in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
andrei.mita
Forum Commoner
Posts: 65
Joined: Sun May 08, 2005 4:06 am
Location: Barlad/Romania

global variables in php

Post 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?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Try this:

Code: Select all

echo '<HR><PRE>'; print_r($_SERVER); echo '</PRE>';
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Look at the manual for SUPER GLOBALS.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post 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/
andrei.mita
Forum Commoner
Posts: 65
Joined: Sun May 08, 2005 4:06 am
Location: Barlad/Romania

Post by andrei.mita »

thanks again for the support.
andrei.mita
Forum Commoner
Posts: 65
Joined: Sun May 08, 2005 4:06 am
Location: Barlad/Romania

Post 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.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post 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
andrei.mita
Forum Commoner
Posts: 65
Joined: Sun May 08, 2005 4:06 am
Location: Barlad/Romania

Post by andrei.mita »

i thought that might be the function, now i know for sure. thanks
Post Reply