Page 1 of 1

How can i do JS-similar events in PHP?

Posted: Sat Mar 27, 2004 6:40 pm
by joetheeskimo5
I may sound like a complete newbie, but I have a minor question - how can I use JavaScript-like events in PHP? For example, the onClick function. I want to be able to type in a PHP/HTML document:

Code: Select all

<a onClick = "function()">
But rather than the onClick event, i want the PHP equivalent. How can I do this without using an HREF attribute?

Thanks for your help.
Joe

Posted: Sat Mar 27, 2004 7:22 pm
by markl999
If i understand you correctly, then you can't.
PHP is server side, so once a document has 'downloaded' to the client then to call a PHP function/action/whatever a request needs to be made back to the server, which would mean an href or form post, basically another request.