Invoke PHP script from onLoad handler?

From: Date: Fri, 26 Jan 2001 05:09:04 +0000
Subject: Invoke PHP script from onLoad handler?
Groups: php.general 
Request: Send a blank email to php-general+get-36740@lists.php.net to get a copy of this message
Sorry if this has come up before. I want to update a select list from a mySql database whenever the browser window gets the focus. This is because I anticipate that the user will frequently use a second window to make additions to the database that holds the list values while filling in the form, and I want those additions to be in the select list when the user returns. At present I have PHP querying the db before I output the body tag, and an onLoad() handler passes the returned records to a Javascript which populates the list box with the query results, but I have only figured out how to query the db when the page initially loads. I really need to query the db and invoke the Javascript every time the window gets focus. So, I guess my question is twofold: can I invoke a php function with an onLoad handler, and if so, how can I have onLoad do both things - run the php function to query the database, then run the Javascript to populate the list box? Or is there another way? TIA, Chuck Mayo

« previous php.general (#36740) next »