php is server side, wrap the code to make the gui in php, and then write it to the required file(s). have the page redirect to a page that loads the freshly written gui. All this wouldn't take 1 second, and the end user wouldn't be the wiser. a very quick and dirty solution.