Hi,

I have a webpage with articles and I would like to indicate the number of views for each article. Can anyone help me with the correct form/script in asp format?

Thanks

do you have a database?

if so set up a command to update it. so you would have the article number. when the page is called a recordset retrieves the last value and then adds one. the command then updates the record to be the new value. you might want to use sessions though that it doesnt count EVERYTIME the same user views the page for that session. like a refresh of page.

the other way you could do it if your hosting server is stable is use application variables. which would reset if the server ever went down but is the easiest to use.

the other way is via a text file for each page. it reads the text file adds one then writes back to the text file the updated figure. not very practical as plenty text files get created then

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.