PHP Check whether user clicked on the page

Viewed 38

Is there any method to determine whether the user clicked somewhere on the page on PHP? I want to fire a pixel when a user clicked somewhere on the page.

Thanks for your time

3 Answers

The web page showed in the browser and php are separated world.

Yes php on the server generate the webpage which then is sent to the browser which "execute" it.

If you want to track where user click, you should use some javascript which send the x,y to the server via ajax

To get x,y on mouse click you an use the js in this answer

javascript get x and y coordinates on mouse click

But instead of printing it just send them to the server via javasccript.

Related