Re: [PHP] PHP analytics

2006-12-09 Thread Richard Lynch
?php
  //untested code:
  session_start();
  if (!isset($_SESSION['username'])){
require 'login.inc'; //login form to set $_SESSSION['username']
exit;
  }
  $username_sql = mysql_real_escape_string($_SESSION['username']);
  $self_sql = mysql_real_escape_string($_SERVER['PHP_SELF']);
  $query = insert into analytics (username, page) ;
  $query .=  values ('$username_sql', '$self_sql') ;
  mysql_query($query) or error_log(mysql_error() . $query);
?

There are a few zillion refinements to be done here, and you had
better make sure the username you stuff into your $_SESSION is
validated, but, really, it's not exactly rocket science to hack
something up to know what the user clicked, once you force them to
login...

On Wed, December 6, 2006 5:48 am, Rick. wrote:
 Hello



 I am new to php and I would like some guidance from those who have a
 bit more expereince with PHP


 I will be attempting to do a bit of tracking and web analytics.
 Basically, the user will login
 and from there everything that he clicked will be recorded in a
 database and analyzed
 i.e user behaviour, patterns with different user groups.

 Is this possible with php and it is a major undertaking ? just trying
 not to get ahead of myself here..

 are there any tutorials or scripts or books that you know of ?



 Thanks
 Regards
 Rick






-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP analytics

2006-12-06 Thread André Medeiros

Storing the document that is being called and get paramaters on a DB
is very simple

You would have an include like

$doc = $_SERVER['PHP_SELF'];
$get_vars = serialize($_GET);
mysql_query('INSERT INTO logs (page, vars) VALUES (' . $doc . ', '
. addslashes($get_vars) . ')');

Of course you'd need extra info like user id and such, but the
principle is there.


On 12/6/06, Rick. [EMAIL PROTECTED] wrote:

Hello



I am new to php and I would like some guidance from those who have a bit more 
expereince with PHP


I will be attempting to do a bit of tracking and web analytics. Basically, the 
user will login
and from there everything that he clicked will be recorded in a database and 
analyzed
i.e user behaviour, patterns with different user groups.

Is this possible with php and it is a major undertaking ? just trying not to 
get ahead of myself here..

are there any tutorials or scripts or books that you know of ?



Thanks
Regards
Rick







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP analytics

2006-12-06 Thread Edward Kay
What you describe is certainly possible, and many sites have this
functionality.

If you're just starting out however, look into Google Analytics. It gives
you more info than you care to imagine and is free. It's also takes 2secs to
install (except I think there's a waiting list to get your account active).

Edward

 Hello

 I am new to php and I would like some guidance from those who
 have a bit more expereince with PHP


 I will be attempting to do a bit of tracking and web analytics.
 Basically, the user will login
 and from there everything that he clicked will be recorded in a
 database and analyzed
 i.e user behaviour, patterns with different user groups.

 Is this possible with php and it is a major undertaking ? just
 trying not to get ahead of myself here..

 are there any tutorials or scripts or books that you know of ?



 Thanks
 Regards
 Rick






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP analytics

2006-12-06 Thread André Medeiros

Not really, it's instant now. You just have to have a google account.

On 12/6/06, Edward Kay [EMAIL PROTECTED] wrote:

What you describe is certainly possible, and many sites have this
functionality.

If you're just starting out however, look into Google Analytics. It gives
you more info than you care to imagine and is free. It's also takes 2secs to
install (except I think there's a waiting list to get your account active).

Edward

 Hello

 I am new to php and I would like some guidance from those who
 have a bit more expereince with PHP


 I will be attempting to do a bit of tracking and web analytics.
 Basically, the user will login
 and from there everything that he clicked will be recorded in a
 database and analyzed
 i.e user behaviour, patterns with different user groups.

 Is this possible with php and it is a major undertaking ? just
 trying not to get ahead of myself here..

 are there any tutorials or scripts or books that you know of ?



 Thanks
 Regards
 Rick






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP analytics

2006-12-06 Thread Jochem Maas
Rick. wrote:
 Hello
 
 
 
 I am new to php and I would like some guidance from those who have a bit more 
 expereince with PHP
 
 
 I will be attempting to do a bit of tracking and web analytics. Basically, 
 the user will login 
 and from there everything that he clicked will be recorded in a database and 
 analyzed
 i.e user behaviour, patterns with different user groups. 
 
 Is this possible with php and it is a major undertaking ? just trying not to 
 get ahead of myself here..

yes and probably (depending on what and how much you want to log and
analyse). may be there is something out there that does what you want already.

the logging part is easy enough - it's a question of
performing an INSER on some database table!

 
 are there any tutorials or scripts or books that you know of ?
 
 
 
 Thanks 
 Regards
 Rick
 
 
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP analytics

2006-12-06 Thread Vincent DUPONT

You could look for Apache logs analysers, too

vincent

-Original Message-
From: Rick. [mailto:[EMAIL PROTECTED]
Sent: Wed 6/12/2006 12:48
To: php-general@lists.php.net
Subject: [PHP] PHP analytics
 
Hello



I am new to php and I would like some guidance from those who have a bit more 
expereince with PHP


I will be attempting to do a bit of tracking and web analytics. Basically, the 
user will login 
and from there everything that he clicked will be recorded in a database and 
analyzed
i.e user behaviour, patterns with different user groups. 

Is this possible with php and it is a major undertaking ? just trying not to 
get ahead of myself here..

are there any tutorials or scripts or books that you know of ?



Thanks 
Regards
Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP analytics

2006-12-06 Thread André Medeiros

Do those log GET params?

On 12/6/06, Vincent DUPONT [EMAIL PROTECTED] wrote:


You could look for Apache logs analysers, too

vincent

-Original Message-
From: Rick. [mailto:[EMAIL PROTECTED]
Sent: Wed 6/12/2006 12:48
To: php-general@lists.php.net
Subject: [PHP] PHP analytics

Hello



I am new to php and I would like some guidance from those who have a bit more 
expereince with PHP


I will be attempting to do a bit of tracking and web analytics. Basically, the 
user will login
and from there everything that he clicked will be recorded in a database and 
analyzed
i.e user behaviour, patterns with different user groups.

Is this possible with php and it is a major undertaking ? just trying not to 
get ahead of myself here..

are there any tutorials or scripts or books that you know of ?



Thanks
Regards
Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php