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
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Tue Jul 02, 2013 12:44 am
I was wondering how easy or hard to open a log file and write results, such as page viewed etc
i have code to find the IP address of the client
Code: Select all
<?php
echo ' Client IP address: ';
if ( isset($_SERVER["REMOTE_ADDR"]) ) {
echo '' . $_SERVER["REMOTE_ADDR"] . ' ';
} else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) {
echo '' . $_SERVER["HTTP_X_FORWARDED_FOR"] . ' ';
} else if ( isset($_SERVER["HTTP_CLIENT_IP"]) ) {
echo '' . $_SERVER["HTTP_CLIENT_IP"] . ' ';
}
?>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Tue Jul 02, 2013 5:34 pm
seems to be overkill, i was thinking opening in the docroot a csv file and write to that
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Tue Jul 02, 2013 10:12 pm
Then do that!
(#10850)