Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow PHP and XML speed problem

    Hi everyone. I am building a website that performs some requests to another server, retrieves the information and then displays it. The requests are made with XML files that are dynamically created from my page. My website works like this:

    There is one page with a form where the user must enter the search criteria. Then the form posts the user entered data to another webpage.

    The second webpage puts them into an XML, posts it using cURL and stores the response into a string variable. The variable then is parsed with PHP’s simple XML and echoes them.

    The problem is that went the second page loads, the status bar say that the page is loaded while the page seems blank. After a while the page starts to load again and the displays the retrieved data. I tried to find out why this happens and I erased everything except from the XML that is posted and the cURL code that posts it and assigns the response to a variable, so I came up with the conclusion that cURL is responsible. The XML that I send is about 15 to 20 lines long and it’s well formatted so I don’t think the XML is the problem, but the response XML might be huge depending on the search data entered.

    Can anyone tell me how to fix this problem or how to display a “Loading…” or something while the page seems blank? I’m sorry for the huge post. Thanks in advance!

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is the result displayed in a table (an html table)?
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi. Thanks for the reply. I echo a table. Inside the table there are some variables to output the the results i parsed with simple XML from the response XML. The table i repeated in order to display all the results. I stored the response XML in a file and parsed it localy to see if the parser is my problem but i had no delay. When i receive a response from the remote server i have a different delay time every time i make a new query. I think my code and the XML i send are well writen. What could be the problem? Thanks again!

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is it a large table? because a table will only be displayed when it's completely loaded into the browser. first the browser will load the complete code for the table and usually will then rerender the page (which you can see sometimes when the pages stretches etc)

    Maybe the problem is that the content isn't streamed quick enough to the client and/or rendered fast enough by the browser.

    try just echoing out the response, without putting it into a table. You might then get a page that starts displaying content as soon as html code is received (depending on what browser you use, of course)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #5
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I deleted everything and left only the curl function that posts the XML and i echoed the response XML but i had a delay once more. There are only 40 lines of code left. I don't think that this is the case. Thanks for the quick reply.
    Last edited by X-Piral; 02-09-2006 at 05:23 PM.

  • #6
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did you try echoing the microtime at strategical positions in your code to get an idea on the duration of each step?

    code for a timer --> http://www.codingforums.com/showthre...timer+function
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •