What code do i need to add so that i can have a view counter for each video on my site? http://www.watchspongebobonline.net/ and if someone goes here: http://www.watchspongebobonline.net/index.php?action=season&id=2&episode=33 the hi counter would go up for that page etc... i've been searching and couldn't find anything.. Please help.. thanks
hmm... so does that mean that every time someone clicks the link, the link id goes into the database and everytime someone clicks it the counter goes up? what piece of code would work for that? thanks
in all honesty, theres several ways to do this. . . we would need more information than you have provided. To give you a brief generalization of how I'd do it 1. have a datgabase with a table row for each video. one of the entries in that table row would be "views" 2. have a php script on the video page that retrieves that number when the video is viewed. 3. increment that number 4. update the database entry Like I said, you haven't given much information on the elements your working with or your level of experience, I hope I'm not insulting you with the rest of this list, but if you are not familiar, you need to get familiar with 1. connect to the database 2. query the database 3. update the value 4. set the value If you don't know how to do that, you'll have to study and get it. If someone gave you a script it would not be accurate, as to how each different database has a different way of connecting and shuffling values. Your script is specific to your database. There are other ways, such as an xml file, or even a simple data file. but that would get alot more complicated.