Hi I'm trying to got input from JS event OnClick () that we'll count how many time th visitor press on link and store it in MySQL DB the JS Code will be something like this <a href="http://www.mysite.com/index.php?p=324" OnClick="Count The Clicks" > My Link </a> HTML: So the clicks can stored on PHP variable or on Function so I can call it any time on the site. as i read that can do it using HTML Post attribute so can assist values of click times ..Or using AJAX because it have ability to communicate with the server
JUST php: on submit form, call a php script to count the click, and save it to the database. then redirect to your link location.
You need to move ajax solution. I'm not sure, but to give you a fast hint is: <a href="http://www.mysite.com/index.php?p=324" OnClick="count()" > My Link </a> function count(){ // now ajax request to server to update count in db // simple ajax get request to php code here.... return true; } since the function returns true, user will be taken to link and also before that hit counter code executes...