[thelist] Counting downloads via hyperlink

der wert derwert at hotmail.com
Mon Jul 24 12:53:12 CDT 2006


from the php manual, you just need to add the DB code.

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>


On 7/24/06, Tom Dell'Aringa <pixelmech at gmail.com> wrote:
>On 7/24/06, Chris Dempsey <evolt at cubeit.co.uk> wrote:
> >
> > If you can code with PHP you could point the Download PDF link to a page
> > page which will record the click before showing the link to the file.  
>You
> > can record the click either in a database or a text file using the file
> > system [not sure what the PHP equivalent is but in Classic ASP it's 
>called
> > the FileSystem Object].
> >
> > eg.
> >
> > - User browses page with PDF links
> > - User Clicks Link to get PDF they want
> > - Link points to counter page and passes unique file ID
> > - counter page updates download count for requested file then displays 
>the
> > real link to the file
> >
> > Not very gracefully put but think you'll get the idea.
>
>
>Thanks for all the ideas so far. I don't want to have to mess with the log.
>I should have mentioned the PDF links are all on one page and I really 
>don't
>want to have an interstitial page or have them have to browse pages to get
>to the pdf, so it has to work within the one page. If there was a way to
>trigger some php on an href click, I could add them up in a mySQL table or
>txt file somewhere perhaps?
>
>Tom
>--
>
>* * Please support the community that supports you.  * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !
>

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/




More information about the thelist mailing list