473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

user/page tracking

junior29
Hi,

I just wondered if anyone could help me at all. I'm doing a piece of coursework building a social network (which is getting there!), we are supposed to add an administration element to include tracking of access of pages by registered users to include their username, date and time of access, browser used, ip address of user and which page was accessed. This is to be put into a report to then be able to be sorted by page, user and by browser.

I'm fairly new to PHP programming and have used many hours online trying to find tutorials to guide me through. This has stumped me at how to request all this information into an array and being able to store in a db or file then echo this out with the ability to sort it. We have restrictions on our server to write to a txt file, though I can write to db fine. I've found resources that show me individual elements like getting the ip address etc, but I'm yet to find something that helps me to get all this information. I think I'm struggling with how to put it all together.

The site itself uses sessions for authentication.

I hope someone can help, many thanks in advance.
Feb 24 '08 #1
10 1485
ronverdonk
4,258 Expert 4TB
This is a site for programmers helping programmers, not a code factory. So, if you want our members to help you, show the code you have developed so far and we will have a look and see what is wrong.

And do not forget to enclose any code you show, within the appropriate code tags!

Ronald
Feb 24 '08 #2
Markus
6,050 Expert 4TB
And welcome to theScripts!
Feb 24 '08 #3
Hi,

ok, i've already built the social network site that has a register/login process, upload image system, edit profile area, private messaging, open forum etc..

the part im stuck is where to start with tracking the members only pages by which user access them, when, etc... ive been looking for tutorials that show how to extract the IP address or browser information, though individually not together so that it could be made into a report..

im not sure where to start with this, whether there needs to be some tracking function with the pages?? ive searched for tracking etc and just is confusing me..

not asking for code, just a bit stuck as to how to approach this..
Feb 28 '08 #4
nathj
938 Expert 512MB
Hi,

You can get teh users IP address via getenv('REMOTE_ADDR'), take a look at the environment variables under php - run a page with phpinfo() on it and you'll see them all. This will show you wat information you can access using getenv. you should be able to get everything you need.

If you are going to rack the activiy of users once they are logged in you really needto use a DB - it will make the reporting side of your project so much easier.

I would, at the start of every page, check if this is a logged in user. If it is then retreive the data you want and store it to the database.

That's the basic logice I would use to approach this problem.

When it comes to reporting it simply means retrieving the data from the database and with the desired order set. The user can then re-set the order and you can reorder the data and display it again - this could be done very nicely with AJAX.

I hope this gives you some pointers in the right direction.

Cheers
nathj
Feb 28 '08 #5
ronverdonk
4,258 Expert 4TB
I guess you haven't looked into Dennis Pallett's (famous) article about tracking users (ip address, page, referrer, date/time, useragent, remote host) and all in PHP at Track Your Visitors, Using PHP

Ronald
Feb 28 '08 #6
Thanks, that looks very helpful!

Our server has restrictions with writing to txt files but can easily change that aspect to work with a db using insert into!..

Thank you.. i didn't see this amongst the hours of searching.. sometimes can look past things im sure i have many times..

I'll see how i get on now with this.. thank you once again..
Feb 28 '08 #7
ronverdonk
4,258 Expert 4TB
Glad I could help out. See you next time.

Ronald
Feb 28 '08 #8
Hi!

To update, the link helped a lot to structure the tracking, i've basically created a tracking file and included it on each page i wish to track, then stored the data in a db, which is working great

Just a quick question really... would there be any reason why it doesnt include the data of pages viewed using IE, netscape and safari?

I've just sat testing that its picking up from other browsers and it doesnt seem to add it from internet explorer, netscape and safari.. bit confused by that?? but does pick up firefox and opera!
Mar 3 '08 #9
Resolved! I had to change names and alter the length of the varchar in the database it now picks up every browser instead of just two...
Mar 6 '08 #10
ronverdonk
4,258 Expert 4TB
That puzzled me, but I am glad you found it. See you around.

Ronald
Mar 6 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: marslee | last post by:
I want to prevent non-registered users to view a page in my website, For example, when a non-registered user clicks the history page, the website site refuses to go there since he is not...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
1
by: farsad nasseri | last post by:
Hi I'm trying to design a web application where people can create user Ids and passwords while signing up and then use that information to login to an account. (I know, very basic). I just can't...
5
by: byrocat | last post by:
Sybase and DB2 both have the capability of tracking user activities at a number of levels: invalid access attempts to databases, table, etc.; creation/deletion/modification of database...
1
by: craigkenisston | last post by:
Hi, I recently read a lot about a topic called page hijacking. It seems that you can steal page rank from search engines while doing a redirect. I reminded I had a code in some pages, where...
1
by: kasterborus | last post by:
Hi, My client is using the UBB Threads forum and I was recently asked to look into adding the ability to track the activity of each of the users to see who is more active than others. Users are...
4
by: Flarky | last post by:
Hi all, I have a page that has links to other pages. I want to be able to detect when the user has clicked on Back (or typed Backspace) to move back to my page. Is this possible? Thanks.
7
by: Ben Amada | last post by:
Hi ... I have an HTML page containing a bunch of <alinks. Some of the links redirect the visitor to a page at a different website in a new browser window (target=_blank) and other links are...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.