Re: tracking file usage [message #184410 is a reply to message #184380] |
Mon, 30 December 2013 20:06 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Mon, 30 Dec 2013 02:33:05 +0000, Doug Miller wrote:
> richard <noreply(at)example(dot)com> wrote in
> news:17slpz3qunv5p.1owoaoax5minf$.dlg@
> 40tude.net:
>
>> I know how to do the standard hit counter with php.
Allegedly. I remain unconvinced that you can competently code anything.
>> In my music pages, javascript controls the calling and playing of the
>> music.
> And what controls actually retrieving the music from your server?
Possibly a request originating in his javascript?
>> So I was wondering if PHP had any means of knowing when a particular
>> file was being called for.
>
> Obviously it has. It isn't the javascript in the client that's
> retrieving a music file from your server.
It could well be the js in his client that's requesting it, I suspect
what you mean to say is that it's not the js in his client that's serving
it.
>> Or could "onclick" trigger a php function?
> Yes, of course, if you write the appropriate Javascript onclick()
> handler.
Richard, if you want to track download requests then you need to code a
mechanism such that calling a url like:
http://dumbass.website.com/some/path/getmusic.php?q=blah
will interpret blah as identifying a specific music file, and then server
the file up with the appropriate mime type, whilst at the same time doing
any record keeping such as updating the "how many times has file x been
downloaded" count.
Note - the following are the ways in which you are expected to fuck up
this coding task:
1) Misuse the assignment operator as a test for equality.
2) Bugger up the http header handling.
3) Something to do with array indexing.
4) Generation of broken sql.
5) Generation of broken html (which you'll then blame on the browser).
6) Failing to allow for the simultaneous requests for the same file in
your counting mechanism.
7) String quoting.
8) Something new which will leave us yet again astounded by your
ignorance and stupidity.
I know I won't be disappointed.
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|