PDA

View Full Version : Can I use global.asa for this?


Scrowler
07-24-2003, 08:21 PM
Can I use global.asa to do a hit counter? Eg
sub onstart
program("hitcounter")+1

? Now I know I can't use text files because my host doesn't allow file permissions.
Also, can you add text to it?
Like can you say enter your name. Then when they do, and click submit it adds it to a part of global.asa to be viewed on another page?

oracleguy
07-24-2003, 09:47 PM
You can save the hit counter information to a database. You can log IP addresses too if you wish so you could track unqiue visitors.

As far as displaying someones name, just use a cookie (http://www.w3schools.com/asp/asp_cookies.asp) so when they return it remembers them.

Roy Sinclair
07-24-2003, 11:08 PM
No, global.asa isn't a good place for that. Anything put into a global.asa variable will be reset the next time the application is started. You need to store a counter variable in a more permanent place.

Scrowler
07-25-2003, 01:26 AM
Can someone post how to add lines into a access db then show the contents of the table on another page? I know how to do it in PHP but ASP, is bit newer to me.. I will look for an ASP DB hit counter on hotscripts.com. Thanks.

whammy
07-25-2003, 02:35 AM
I actually posted a counter script that I use here awhile back that uses an access database, and also records ip addresses, etc.... you can probably find it by doing a search.

Scrowler
07-25-2003, 04:46 AM
Thanks, I will look for it