Re: [PHP] Most viewed?



At 10:41 AM -0500 4/15/08, Steve Marquez wrote:
Greetings,

Can any of you point me in the right direction on how to use PHP to create a
most viewed or most clicked articles list? Can it be done with PHP?

Thank you so much,

Steve Marquez
smarquez@xxxxxxxxxxxxxxx

Steve:

There are a couple of ways to do this: 1) use mysql to record each download; 2) use a file to record each download.

All you do is pass the user's click to a php script that records the transaction -- incrementing a counter in either mysql or a file and delivers the content to the user. You can include that number in your html to show how many transactions, if you want.

This is an example of using a file:

http://www.webbytedd.com/b/readwrite-download/

Cheers,

tedd


--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.



Relevant Pages

  • Re: Most viewed?
    ... Steve Marquez wrote: ... most viewed or most clicked articles list? ... Can it be done with PHP? ... Modify your article display code so that when it loads it increments the reads field for that article. ...
    (php.general)
  • Re: [PHP] Patterns
    ... On 6/7/07, Steve Marquez wrote: ... If the file ends in .php, then I want it to unlink from a certain folder. ... // Do your unlinkroutine for .htm/.html files here.... ...
    (php.general)
  • Re: [PHP] PHP Auth
    ... Steve Marquez wrote: ... What is the best way to create authentication for MySQL info displayed ... on PHP pages. ... onShore Networks ...
    (php.general)
  • Re: [PHP] GD Library
    ... On Thu, 13 Sep 2007, Steve Marquez wrote: ... I am very novice on PHP, and am using a Mac with 10.3.9. ...
    (php.general)
  • Re: HELP: strange php behavior downloading html
    ... problem in less than an hour, using cURL with PHP. ... Here is the function I wrote to download a uri into a file (following ... all redirects, ignoring old cookies, and passing set cookies to redirects): ...
    (comp.lang.php)