php - dont wait for script to finish -


I have a PHP script that sends the SMS, the problem is that before some SMS is sent to my The page in the site will wait until this script runs. How can I give a message to the user that the SMS will be sent and the normal operation of the site will resume.

The only issue here is that the browser thinks that it is awaiting more output from the script when Nobody will be there. You can put a load in a different process, or you can use an asynchronous web call, or you just .....

  & lt; Php register_shutdown_function ('when_alls_done'); .... // Present Page Exit; Function when_alls_done () {if ($ _REQUEST ['send_to_phone']) {send_sms ($ _ request ['send_to_phone'], $ _REQUEST ['message']); }}  

The request should flush the webserver on 'exit' and the browser should know that the response has been completed (before that there is a clear flush in the PHP code The webserver buffer will not flush or the result will result in encoding with another part)

c.


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -