Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Directory Submission Service   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 06-03-2004, 09:51 PM   #1 (permalink)
Inactive
 
Join Date: 06-03-04
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

phpistasty is liked by many
Send a message via AIM to phpistasty
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?
phpistasty is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 06-03-2004, 11:58 PM   #2 (permalink)
Inactive
 
Join Date: 05-27-04
Posts: 83
iTrader: 0 / 0%
Latest Blog:
None

BeetMan is liked by many
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.
BeetMan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 03:19 AM   #3 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
Why not sessions. It'll work if you only need to track them on your site. Could be 2 fields.. id and session.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 09:10 AM   #4 (permalink)
Inactive
 
Join Date: 06-03-04
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

phpistasty is liked by many
Send a message via AIM to phpistasty
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
phpistasty is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 11:22 AM   #5 (permalink)
Inactive
 
Join Date: 05-27-04
Posts: 83
iTrader: 0 / 0%
Latest Blog:
None

BeetMan is liked by many
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.
BeetMan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 12:10 PM   #6 (permalink)
Inactive
 
Join Date: 06-03-04
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

phpistasty is liked by many
Send a message via AIM to phpistasty
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..
phpistasty is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 12:47 PM   #7 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
i wuld just do a mysql system with a table that is like

users ip | site id
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 12:59 PM   #8 (permalink)
Inactive
 
Join Date: 05-27-04
Posts: 83
iTrader: 0 / 0%
Latest Blog:
None

BeetMan is liked by many
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.
BeetMan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 01:20 PM   #9 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
then make ppl have to make user accounts
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 01:21 PM   #10 (permalink)
Inactive
 
Join Date: 06-03-04
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

phpistasty is liked by many
Send a message via AIM to phpistasty
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
phpistasty is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > 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

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

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 11:22 AM
Tracking PageRank digitalpoint Google Forum 6 03-28-2004 12:57 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 06:43 AM.
© Copyright 2008 V7 Inc