FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » tracking file usage
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
tracking file usage [message #184378] Mon, 30 December 2013 02:21 Go to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
I know how to do the standard hit counter with php.

In my music pages, javascript controls the calling and playing of the
music.
So I was wondering if PHP had any means of knowing when a particular file
was being called for.
Or could "onclick" trigger a php function?
Re: tracking file usage [message #184379 is a reply to message #184378] Mon, 30 December 2013 02:31 Go to previous messageGo to next message
Scott Johnson is currently offline  Scott Johnson
Messages: 196
Registered: January 2012
Karma: 0
Senior Member
On 12/29/2013 6:21 PM, richard wrote:
> I know how to do the standard hit counter with php.
>
> In my music pages, javascript controls the calling and playing of the
> music.
> So I was wondering if PHP had any means of knowing when a particular file
> was being called for.
> Or could "onclick" trigger a php function?
>

sure

scotty
Re: tracking file usage [message #184380 is a reply to message #184378] Mon, 30 December 2013 02:33 Go to previous messageGo to next message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
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.
>
> In my music pages, javascript controls the calling and playing of the
> music.

And what controls actually retrieving the music from your server?

> 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.

> Or could "onclick" trigger a php function?

Yes, of course, if you write the appropriate Javascript onclick() handler.
Re: tracking file usage [message #184410 is a reply to message #184380] Mon, 30 December 2013 20:06 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
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
Re: tracking file usage [message #184411 is a reply to message #184410] Mon, 30 December 2013 20:22 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 12/30/2013 3:06 PM, Denis McMahon wrote:
> 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.
>

+1

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: tracking file usage [message #184430 is a reply to message #184411] Tue, 31 December 2013 18:32 Go to previous message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 30.12.2013 21:22, schrieb Jerry Stuckle:
> On 12/30/2013 3:06 PM, Denis McMahon wrote:
>> 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.
>>
>
> +1

+2


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: OT: Where IS everybody?
Next Topic: ORMs comparisons/complaints.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 13:05:55 GMT 2024

Total time taken to generate the page: 0.03191 seconds