473,804 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

user/page tracking

junior29
5 New Member
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 1515
ronverdonk
4,258 Recognized Expert Specialist
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 Recognized Expert Expert
And welcome to theScripts!
Feb 24 '08 #3
junior29
5 New Member
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 Recognized Expert Contributor
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 Recognized Expert Specialist
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
junior29
5 New Member
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 Recognized Expert Specialist
Glad I could help out. See you next time.

Ronald
Feb 28 '08 #8
junior29
5 New Member
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
junior29
5 New Member
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

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

Similar topics

2
2619
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 registered. what is the best way to do it? And how to identify a user has already logged in when he click the history page?
5
1918
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 ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
1
1233
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 get my mind around how to make this system most secure. the user id and password is verified at the time of logging in and at that point, I would like to create something like a session key before openning the new page. I basically don't want to...
5
5353
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 objects/users/groups, grants/revokes. For MS SQLServer, the only setting that I've seen in the documentation is access attempts (none, fail only, etc.) The monitor program has the capability of tracking the events that I want to be monitored, but it...
1
1870
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 someone clicks a link on my site, I first go to a page to save the link, then I have a redirect to the site (I want to count this clicks out).
1
5988
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 identified by a cookie. Now can this be done at the server level somehow? Or would it be easier to include a tracking function in each page that records a per user hit count?
4
2966
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
1983
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 "mailto" links. What I want to do is record a little information when they click on a link (mainly which link they are clicking on). I can put together a server side webpage that can receive this information and store it in a DB. I'm just not...
3
3292
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 "Searching..." page then, refreshes and displays the table I want. I have code that grabs data from the page using cURL but when I look at the data it contains the "Searching..." page and not the table that I want. below is the code i have so far....Thanks...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10353
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.