Forum Moderators: coopster
Problem is the .exe file takes about 30 seconds to run, and has to run before the php page loads, so the visitor is left looking at the form submit page with no real feedback.
What would be the normal way of providing user feedback in this situation? Ideally I'd like to be able time the script and tell the user how long they had left to wait using a nice moving bar. Otherwise I guess some generic "page loading" image started on form submit.
What does everyone else do in this situation?
Are you thinking javascript or is there a cunning intermediate step I can take and use php? I'm very rusty on web and php and was never that good to start with.
I've never done something like that, but that's what I would try.
I've got a workaround with a bit of javascript. Browser requests the page with the form and it checks if they have javascript installed (maybe I'll show an alternative page if not).
Form OnSubmit calls a javascript function that un-hides a div with the loading graphic. Hopefully I can get some indication of time in there, though I have a suspicion javascript will stop working after I've navigated away from the page.
Form is posted to php page with shell_exec(), but the previous page with the loading graphic still shows until the program has executed. Right after the shell exec I've got a header redirect to a results page with an ID in the address so I know which results to show.
Beauty of this is a back button from the results page takes the visitor back to the form page, missing out the executable, but it might be less user-friendly for those without javascript.