---- Arno Kuhl <akuhl@xxxxxxxxxxxx> wrote: > I know popup windows are a client-side issue, but I can't figure how > to create and close a popup window from the server side only on > condition, otherwise display normal browser page. > > What I want is to accept a form, check the input, if there are errors > return them to the browser, if there aren't errors then popup a modal > window and start processing (a possibly long process) while displaying > results in the popup window, then automatically close the popup after > processing is complete and redirect to normal browser page with the > final results. I want to use the popup to (a) feedback ongoing > progress to the user, and (b) keep the browser side alive because the process could take several minutes. > > Googling for +php +popup is getting me nowhere, all the results are > for javascript. I know how to create a link or button that when > clicked will create a popup that will display the results of a php > script, but I need to do it the other way round. Can anyone please > suggest some pointers on how to generate a conditional popup from the > server, and then get the server to close it when done. > > Thanks > Arno That's because it is a CLIENT side issue, the server isn't able to do it. If you want to provide feedback on the form, then look into Ajax or use output buffering and flushing to push out a status message as the form is processed. You could do this in a javascripted pop-up window or on the window they submitted the form. If it takes your script minutes to process a form you need to look into your processes. I'd suggest verifying the form had all the pieces and then advising them you will email them when the registration or what-not is complete. HTH, Wolf =============================== I fully understand this is a client side issue, but figured there may be a way for the server to drive it using smoke and mirrors. For instance if the input is ok I thought of redisplaying the completed form with an onload to popup a modal window, then output progress to the window until the process was finished, then send something to the window to close itself. But after that I get stuck because I don't know how to make the underlying browser page request the final results from the server, or have some way for the php script to push the results to the page without a request. Or maybe it's all javascript, with the browser page waiting for the window to close before requesting the results? (though I see some timing issues with that solution, unless I create a temp results page waiting for the browser's request). Has anyone on the list done anything like this, or have any pointers, examples or ideas? (BTW Wolf's suggestion of sending the results via email is not an option in this case) Thanks Arno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php