onMouse php event question

nightscream

New Member
Messages
948
Reaction score
0
Points
0
i got a problem
i want to create a counter how many times something is downloaded(link clicked)
my code
HTML:
 onMouse="php file"
but how can I let it do the action that is in the php file?
 
Last edited:

Conor

New Member
Messages
3,570
Reaction score
0
Points
0
Well I don't know PHP very well but I do know Action Script.

Wouldn't you create a function that tells the script to release that PHP event when the link is clicked?
 

The_Magistrate

New Member
Messages
1,118
Reaction score
0
Points
0
You wouldn't use the onMouse event to capture clicks for a download counter. You would point a normal link to the PHP file and perform the counter actions in the PHP. This allows you to store the number of clicks in a text file/database on the server. One the click is counted, you redirect the client to the actual file they want to download. Use this PHP to do the redirect:

PHP:
Header("Location: $url");

Note, you cannot send any data to the client before you do the redirect or you'll get an error about the headers already being sent.
 
Top