Hello, i want to call a php function when an event occurs, just like a javascript function. I've tried all the ways around, but nothing seems to work, please can somebody help me?
How to call a function
What type of event?
If you mean a user-triggered event, you can't call it if you don't refresh the page.
PHP runs on the server, and when the page in your browser is loaded, no more PHP can be executed.
Unless you refresh it.
knutm :-)
I see, i meant events like onclick or onchange. Well, the thing is I have two select boxes, let's say, state select box and cities select box. What I want to do is the logical thing: when I select a state, i want to see in the other select box all its related cities, but if i change the state, i want the select box of cities "automaticly" refresh with the new values, you know what i mean?
Thanks for your help
Yeah, he knows what you mean; and, he told you that unless you refresh the page, you can't do it with PHP, because it's server side.
Try this site, perhaps.
The events that PHP will respond to are called HTTP requests (GET, POST, etc.) PHP is for controlling servers.
Controlling browsers is for Javascript.