Page 1 of 1
Does PHP have 'event-handler'?
Posted: Sun Jun 18, 2006 10:47 pm
by chakhar86
In javascript you can easily run function when an 'event' occured...
can this 'event-handler' (onchange, onload, etc.) implemented in PHP?
Posted: Sun Jun 18, 2006 11:01 pm
by tecktalkcm0391
Yes an no. Not directly in PHP, but with Javascript and PHP together (AJAX) it can.
Posted: Sun Jun 18, 2006 11:20 pm
by chakhar86
tecktalkcm0391 wrote:Yes an no. Not directly in PHP, but with Javascript and PHP together (AJAX) it can.
and how can it be done? or where we can find its guide or manual...
Re: Does PHP have 'event-handler'?
Posted: Sun Jun 18, 2006 11:24 pm
by RobertGonzalez
chakhar86 wrote:In javascript you can easily run function when an 'event' occured...
can this 'event-handler' (onchange, onload, etc.) implemented in PHP?
No. The only event handler PHP has (for web apps anyway) is a server page request. PHP is server side. In order to initialize any PHP commands or code, you need to tell the server to process something. That is done through a page request (like I said, for web apps at least). Even with AJAX, processing ocurrs on the server. The JavaScript event handlers trigger the server interaction.