Jump to content

[SOLVED] Log actions?


Cory94bailly

Recommended Posts

It all depends on how the program/script works...

 

For example, for this forum (SMF), you can record the actions by the "action" in the url (get method). Like: action=post, action=register, and so on...

 

Different program works differently, I can't tell you how to do something I don't know about...

Link to comment
Share on other sites

get it so that on every page there is a

<?php
$pagename = basename($_SERVER['PHP_SELF']);
date_default_timezone_set('UTC');
$time = date();
?>

And get the script to insert that data into a mySQL database when the page loads. You can also have it log usernames, id's and other things too if you declare variables for them. Although this type of logging system will be hard on a high traffic website as there will be way too many MySQL Query's being performed per second

Link to comment
Share on other sites

get it so that on every page there is a

<?php
$pagename = basename($_SERVER['PHP_SELF']);
date_default_timezone_set('UTC');
$time = date();
?>

And get the script to insert that data into a mySQL database when the page loads. You can also have it log usernames, id's and other things too if you declare variables for them. Although this type of logging system will be hard on a high traffic website as there will be way too many MySQL Query's being performed per second

 

 

Fatal error: Call to undefined function: date_default_timezone_set() in /home/content/m/a/r/markbailly/html/test69.php on line 3

Link to comment
Share on other sites

Although this type of logging system will be hard on a high traffic website as there will be way too many MySQL Query's being performed per second

 

What is the best way to log actions?

 

using PHP and MySQL but only on low traffic websites. If you have a high traffic website then a larger bandwidth would have to be required

Link to comment
Share on other sites

get it so that on every page there is a

<?php
$pagename = basename($_SERVER['PHP_SELF']);
date_default_timezone_set('UTC');
$time = date();
?>

And get the script to insert that data into a mySQL database when the page loads. You can also have it log usernames, id's and other things too if you declare variables for them. Although this type of logging system will be hard on a high traffic website as there will be way too many MySQL Query's being performed per second

 

Ok I did that..

 

I contacted my host, upgraded to php5 and now I get this:

 

Warning: date() expects at least 1 parameter, 0 given in /home/content/m/a/r/markbailly/html/test69.php on line 4

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.