Hi,
I need a help regarding executing the script asynchronously,I have a html form with submit button.When i click the submit button it is calling php script(ex script1.php which is to send mail).For script1.php am passing some values(id,name,email) from Html page. script1.php taking long time to send the mail.so i want to run that script asynchoronously when submit button gets clicked.
give me a suggestion..Am using windows xp OS.

    Call the script from an Ajax call. It won't change anything on the page, it will just call that script and wait for its output, then you can do whatever you want with that.

    Unfortunately, PHP does not natively support forking processes in the background for stuff like this, so you don't have a lot of choice.

      Ashley Sheridan;11001552 wrote:

      Unfortunately, PHP does not natively support forking processes in the background

      So you're saying [man]pcntl_fork/man doesn't exist? :p

        Not exactly, I am aware of it, but it's not generally part of typical PHP builds, so I tend not to consider it as an option when someone asks to do something like this.

          You might also check out [man]ignore_user_abort[/man].

            Write a Reply...