Entry
How do I execute a function when a checkbox is clicked or a value of a combo box is changed using PHP?
Jul 13th, 2000 13:04
Ben Udall, Kamel Jabber,
When a PHP script is accessed by a web browser, the web server runs the
entire script and sends to output back to the browser.
Say, you go to the page http://www.php.net/index.php
1) Browser application sends a request for index.php from the web
server at www.php.net
2) The web server sees that the page requested is a php script, and
runs script on the web server.
3) The output of the php script is then sent back to the browser as the
web page.
Until the browser requests another page (i.e. user clicks on a link, or
submits a form) no more communication takes place between the browser
and the server.
Since the browser doesn't tell the server if the user does anything (ie
change a combobox) it isn't possible to have a PHP function run after
the page has been loaded.
I would suggest looking into javascript. Since most javascript is run
by the browser and not the web server, it might be able to do what you
want.