Re: Multithreading in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My suggestion is that you can start a second ajax as soon as the response 
about validating data is returned to process everithing you need and so your 
user wont wait until the process is finished.

João Cândido

"Manoj Singh" <manojsingh2121@xxxxxxxxx> escreveu na mensagem 
news:3859a530903170639m6c2af2b2s941446a31103cf2a@xxxxxxxxxxxxxxxxx
Hi Alpar,

Thanks for reply.

Actually the form is submitted through ajax request and the validation is
checking on the server side. So if any error occurs on submission of form,
then we are displaying the errors to the user. And is there is no error,
then the submitted page started processing. So here client has to wait until
the page process completed or not. What i want here if possible, after
validating the user input server sends the thanks response to the client so
that cleint doesn't has to wait, then the server starts the processing.
Please suggest if it is possible.

Regards,
Manoj



On Tue, Mar 17, 2009 at 7:01 PM, Alpár Török <torokalpar@xxxxxxxxx> wrote:

> 2009/3/17 Manoj Singh <manojsingh2121@xxxxxxxxx>:
> > Hi Guys,
> >
> > I am creating a page which submits the form through Ajax request & the
> > submitted page is sending the mails to n number of users. Now until the
> mail
> > sends or the page process completed the end user has to wait.
> >
> > Is it possible that server sends the response to the client & then start
> > processing so that the client doesn't have to wait for the server
> response.
> >
> > Please suggest.
> >
> > Regards,
> > Manoj
> >
> Since you are using Ajax requests, which by their nature are
> asynchronous , your user won't have to wait. You can write some JS
> code to let him know that the request was sent, and just let the ajax
> call run in the background. On the server side make sure to ignore
> user abort, just in case the user navigates away.
>
>
> --
> Alpar Torok
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux