Page 1 of 1

Using PHP to count how many time a "mailto:" button is click

Posted: Wed Apr 22, 2009 2:48 pm
by larryc
Hello,

I am trying to figure out how to keep track of how many times a "mailto:" button is clicked. It is a button that says Request Ifo and when clicked it brings up the mailto function. I would like to know how many times that button is clicked. I can do a little PHP and a little MySQL. I am just confused how to go about it.

Would I use the JS OnClick function?

This is what my code looks like:

<a href="mailto:info@company.com?subject=I am interested in learning more about your company"><img src="infobutton.gif" alt="" width="175" height="70" border="0" align="right" /></a

Any suggestions or pointing towards the right direction is appreciated.

Thanks

Larry C

Re: Using PHP to count how many time a "mailto:" button is click

Posted: Wed Apr 22, 2009 2:58 pm
by Christopher
You could use onClick to make an Ajax call back to the server to increment a counter in MySQL. Are you using a Javascript library? It will make doing this much easier.

Re: Using PHP to count how many time a "mailto:" button is click

Posted: Wed Apr 22, 2009 3:11 pm
by larryc
I am not using a javascript library. Not really sure what I would do in ajax.

I am not the PHP person my first post may have given the impression I was.