opencombatclan Posted December 10, 2009 Share Posted December 10, 2009 Hey everyone. I got another interesting problem. Lets say a client sends a form to the php server, which includes a file. The php server will be busy for about 30sec, before the upload is complete. Now here is my idea. On the moment the client submits a file/form, php needs to do something FIRST before it continues to receive and process the browsers headers. I want it to write something, say "busy" to my mysql database, before continuing with the upload. So here is my idea: 1. Client sends request to php server 2. Php script is called, and writes "busy" to the mysql database 3. It continues to read the browser headers (with the file, which takes 30 secs) 4. It echoes "done" to the browser. Now I really hope that this is possible. Php only has to do some server side stuff (it does not need the browser headers) before it continues reading the received headers. Quote Link to comment https://forums.phpfreaks.com/topic/184654-php-execute-something-while-busy/ Share on other sites More sharing options...
JonnoTheDev Posted December 10, 2009 Share Posted December 10, 2009 Why not simply display a graphic on the screen like an animated gif loading bar or something when the form is submitted. Can be done easily with a bit of javascript, HTML and an image Quote Link to comment https://forums.phpfreaks.com/topic/184654-php-execute-something-while-busy/#findComment-974856 Share on other sites More sharing options...
opencombatclan Posted December 10, 2009 Author Share Posted December 10, 2009 You completely miss the point, i kust need to do as describled in my first post Quote Link to comment https://forums.phpfreaks.com/topic/184654-php-execute-something-while-busy/#findComment-975050 Share on other sites More sharing options...
premiso Posted December 10, 2009 Share Posted December 10, 2009 You completely miss the point, i kust need to do as describled in my first post I do not think you can do this with PHP alone, as neil stated you can use Javascript to do this, as it can make a call back when the user presses the submit button, which is what you need. But as far as doing this with just PHP, I do not think it is possible without hacking the core PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/184654-php-execute-something-while-busy/#findComment-975052 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.