Forum Moderators: coopster
Also, since this site will eventually be getting a lot of visitors (hopefully 100K impressions/day) is this method of wring the db every time someone enters a page going to be way too efficient? Should I go about this another way?
Thanks,
Brandon
Cookie users as they come in. make the value their ip. Then all you have to do is write a script that says if there's a cookie UPDATE tracking_table SET count ='#' WHERE ip='$cookie_value'. Of course you'll probably make it more elaborate than this. Cookies will take care of your AOL users that swithc ip's every 3-4 pages because of the aol proxy servers (along with a hand full of other ISPs)
If you're going to use a mod it's fairly simple to do on apache and in IIS.
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/user.html view.php?c=$1
all this is saying is start at the first "/" then between the first "/" and "/user.html" is our variable that will be inserted where the $1 is. So the php engine will process the static because the mod translates it to view.php?c=directory. Bingo you're done. Now if you're going to do more elaborate mod's you'll need to learn rewrite conditions but there's alot of documents out there that explain it.
As for writting to the db for every page. I wouldn't worry about it too much as long as you keep your sql statements as chopped down as possible. basically don't do this "SELECT *..." from a table that has 20 columns when all you need is 2 columns. etc etc.
Now mods can choke a server up so make sure your host has a lot of resources :)