Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP AJAX multiple calls

Options
  • 21-03-2007 11:54am
    #1
    Registered Users Posts: 1,086 ✭✭✭


    I am using a html textarea to take in a reasonable large amount of text from a user. I firstly parse through the text and validate. Then after I have to store the necessary information.

    I could process it all in 1 using PHP but since it usually takes quite long I'd like to somehow use AJAX so the user can see the percent completed.
    What I do now is I recieve the input data and verify it using PHP and then load a page of javascript which will take one row at a time and store the information using AJAX to another PHP page. It only proceeds to the next row once the previous row has completed. However I am getting the popup "A script on this page may be busy, or it may have stopped responding. You can stop it now or continue to see if the script will continue.". I have the choice to stop script or continue.

    Am I doing this the most efficient way or not?

    Any Help?


Comments

  • Closed Accounts Posts: 884 ✭✭✭NutJob


    However I am getting the popup "A script on this page may be busy, or it may
    have stopped responding. You can stop it now or continue to see if the script will continue.". I have the choice to stop script or continue.

    That's a sign your script is running for a long time and you might need to re-think its design.

    Some code would be nice as i cant see how your trying to validate fields. It may be easier to just use regular expressions.... (hard to tell without more info)

    AJAX is useful if your moving through a long form with allot of data but its not the best at updating a data source.

    You have to write the web service behind it and the associated xml schema for the message passing, Debug the javascript, figure out how to update tables with drip fed info to a web service :(

    Splitting the form may be a quick answer if its possible.


Advertisement