Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

write logging information to php file

using php,

i want to write
datetime
browser
ip address


to a textfile
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

You can write to a file with file_put_contents().

DATETIME information is available in PHP date() or the DateTime class object.

Browser and IP are found in $_SERVER and while not 100% reliable they are mostly useful.  Use phpinfo() and look at the bottom of the output to find the $_SERVER information.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

this saves information in a logfile

thanks
You are welcome - thanks for the points.
Avatar of rgb192

ASKER

and thanks for the built in error_log function