How can i do JS-similar events in PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joetheeskimo5
Forum Commoner
Posts: 43
Joined: Sun Dec 14, 2003 4:47 pm
Location: US
Contact:

How can i do JS-similar events in PHP?

Post 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
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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.
Post Reply