Jump to content

php execute something while busy


opencombatclan

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/184654-php-execute-something-while-busy/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.