Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 06-03-2004, 09:51 PM
Junior Member
 
Join Date: 06-03-04
Posts: 23
iTrader: 0 / 0%
php page tracking

I'm working on a script that tracks pages a person has been to. Its main job is to see if the person has been to the page yet. The thing is, it can't be based off cookies because it needs to be accurate, and i don't want to do anything with a database, because... that'd be a lot of fields. Anyone have any ideas?
 
Reply With Quote
  #2 (permalink)  
Old 06-03-2004, 11:58 PM
Member
Latest Blog:
None

 
Join Date: 05-27-04
Posts: 49
iTrader: 0 / 0%
Quote:
i don't want to do anything with a database, because... that'd be a lot of fields.
How many fields? Approximate idea? 10? 1000? 1,000 fields?

I may be missing something but, unless you use some sort of unique login mechanism you have to use cookies to identify the user machine. Of course this is not 100% reliable setup as users may delete cookies.

Without cookies you may sorta identify a mchine by a combination of IP Address+Operating System+Browser. That still is not 100% reliable for some pretty obvious reasons.

You may store some info on the server and regardless of the "number of fields" this is preferred to flat text files because of speed. The number of fields you are worried about is not going to change because you are trying to avoid a database. After all, if you are going to record some type of info about the user, the amount of that info is logically ordered into some kind of record (or array of strings, integers etc) i.e. equivalents of fields. You have to store information somewhere on the server. So you're going to have the same number of fields regardless what technology you use: cookies, flat text file or database.
__________________
In order to understand recursion, one must first understand recursion.
 
Reply With Quote
  #3 (permalink)  
Old 06-04-2004, 03:19 AM
hatchet's Avatar
Senior Member
Latest Blog:
None

 
Join Date: 10-11-03
Posts: 833
iTrader: 0 / 0%
Why not sessions. It'll work if you only need to track them on your site. Could be 2 fields.. id and session.
 
Reply With Quote
  #4 (permalink)  
Old 06-04-2004, 09:10 AM
Junior Member
 
Join Date: 06-03-04
Posts: 23
iTrader: 0 / 0%
The size of the site is constantly growing. And we have to keep track of what pages a person has visited. Each page's main content is an include based off of a variable...f, which is GET. Now, we have to take the name of the include, and keep track of it. If we use a session, then the session dies when someone logs off or closes their browser. Right now we have approximately 750 different pages (f includes). What i'm thinking about doing is creating a txt doc for each user, and just a running list of what sites have been visited.... We have 300 gig of hosting space so it should be fine, and if i place the text file in /var/www then it should be alright for security. What i'll do is i'll search through the text file for the include name, if its not there then i'll add it. :-/ If anyone knows of a better way (i'm sure there is one) it would be greatly appreciated
 
Reply With Quote
  #5 (permalink)  
Old 06-04-2004, 11:22 AM
Member
Latest Blog:
None

 
Join Date: 05-27-04
Posts: 49
iTrader: 0 / 0%
I dont' think the txt files is such a good idea. From what I understand you will be doing a sequential search on records within each file. Sequential searches are very costly in terms of cpu time and disk acess. Databases were created to address this issue.

You can easilly design a table that will do the same, only much much faster. And no, you won't need 750 fields at all. Possibly 3 or 4 in one table.
__________________
In order to understand recursion, one must first understand recursion.
 
Reply With Quote
  #6 (permalink)  
Old 06-04-2004, 12:10 PM
Junior Member
 
Join Date: 06-03-04
Posts: 23
iTrader: 0 / 0%
yeah, the flat-file system was kind of .. last resource.. but we have a pretty hefty machine thats going to be chugging this for us (dual opterons) ~ but instead weve decided to just allow ourselves a mysql table, and a row for each page visit.... but now there are going to be some 4,000 entries as the site its being made for has a lot of active members.. so we're just going to do id-> auto-inc key, user-id-> self explanatory, page-id->self explanatory

we just wanted to avoid huge mysql tables- oh well
thanks everyone..
 
Reply With Quote
  #7 (permalink)  
Old 06-04-2004, 12:47 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
i wuld just do a mysql system with a table that is like

users ip | site id
 
Reply With Quote
  #8 (permalink)  
Old 06-04-2004, 12:59 PM
Member
Latest Blog:
None

 
Join Date: 05-27-04
Posts: 49
iTrader: 0 / 0%
Quote:
Originally Posted by theSpear
i wuld just do a mysql system with a table that is like

users ip | site id
not good enough. Say you have a school or a university. A few students access some external website via LAN - all of the visits will be flagged as coming from the same IP.
__________________
In order to understand recursion, one must first understand recursion.
 
Reply With Quote
  #9 (permalink)  
Old 06-04-2004, 01:20 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
then make ppl have to make user accounts
 
Reply With Quote
  #10 (permalink)  
Old 06-04-2004, 01:21 PM
Junior Member
 
Join Date: 06-03-04
Posts: 23
iTrader: 0 / 0%
well, the idea is to keep track of the number of pages the user visits, ip will be included in the user table, but we don't want the logging to be ip-specific, instead, we want it to be user-id specific..
well i'm going to go back to writing my paper which compares programming languages to countries..php is Italy- the definition of style and beauty
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking Issues - Landing Page - Google Jbounce SEO Forum 1 07-19-2006 12:40 PM
Tracking multiple URLs pointing to the same page ToTheWeb Coding Forum 3 03-23-2005 10:22 AM
Tracking PageRank digitalpoint Google Forum 6 03-28-2004 11:57 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:51 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.