Detect mouse event in php

hi,
can php detect mouse event ? like onclick ,onmouse out …etc ?
If yes what is the function used ?

Nope, JavaScripts’ place

you should start watching the mouse events using the JS then should in someway with ajax to php…

The PHP runs completely before the page is sent to the browser so by the time the first mose evnet happens all your page has in it is HTML, CSS, and JavaScript.

For PHP to be able to process based on mouse events you need to detect the event using JavaScript and then call the PHP from the JavaScript (this process is usually called Ajax).

You can detect mouse movements with Javascript and send AJAX request to PHP page to do some action and return data.

http://www.prototypejs.org is one of the better AJAX frameworks and it handles events in a classical object oriented manner. It’s where you’ll need to start reading to deal with this stuff - but be warned that it isn’t easy.

That’s debatable but IMO for a novice web developer it’s much easier using a well established API such as the one provided by jQuery or Prototype as opposed to straight up DOM Scripting and having to account for a whole slew of cross browser DOM API bugs.