Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3602406
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:44:31+00:00 2026-05-18T20:44:31+00:00

Merry Christmas guys, I found a code that displays a loading message using a

  • 0

Merry Christmas guys,

I found a code that displays a loading message using a gif. It uses the onLoad=”init()” in the body tag. It works fine on an HTML file but it doesn’t when the file is in PHP. Do I need to change anything in here or this just won’t work in a PHP file? here’s the code:

<body onLoad="init()">
   <div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;">
   <img src="loading.gif" border=0></div>

   <script>
     var ld=(document.all);
     var ns4=document.layers;
     var ns6=document.getElementById&&!document.all;
     var ie4=document.all;
     if (ns4)
   ld=document.loading;
     else if (ns6)
   ld=document.getElementById("loading").style;
     else if (ie4)
   ld=document.all.loading.style;

  function init() {
     if(ns4){ld.visibility="hidden";}
     else if (ns6||ie4) ld.display="none";
  }
  </script>

  <?php

  include('simple_html_dom.php');

  $html= new simple_html_dom();

  $html->load_file('urls.html');

  $element = $html->find("p");
  $size = count($element);

  for($i=0; $i <= $size ;$i++){

printinfo($element[$i]->innertext);
  }

  function printinfo($url){

$page= new simple_html_dom();

$page->load_file($url);

$arr = $page->find("title");
echo $arr[0]->innertext." = ";  

$arr = $page->find('.altroute-rcol');
echo $arr[0]->innertext."<br>";
  }
  ?>

  </body>

EDIT: What my php code does is parse some code and displays the info that I needed. The code works fine, depending on how many urls that I need to parse it could take up to 30 secs that’s why I needed a loading message.

Thanks in advance!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:44:32+00:00Added an answer on May 18, 2026 at 8:44 pm

    PHP responses don’t start loading until they’re finished processing. Where a browser will display an HTML page progressively, PHP pages are typically displayed all at once.

    You can force a PHP response to display progressively by calling flush() at the point you want to send a partial response, but support varies between servers.

    Try putting flush(); before you parse your XML and let us know if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Merry Christmas, StackOverflowians! I started out distributing my .NET GAC-located program using Inno Setup,
Merry Christmas everybody!!! I have a personal message system in my page. To show
Merry Christmas. I have a view which contains a uitableview. Iam using wepopover to
I recently came across some Java code that simply put some strings into a
I've got the following C# code segment that takes a list, finds objects that
First of all, Merry Christmas to everyone! Now to my question: Let's say I
First of all, Merry Christmas all! What I've been trying to do is real
Somewhere in our Ruby code, there are three lines that (currently, for debugging purposes)
Merry Christmas, in the spirit of the season I had an idea of a
Merry Christmas everyone. I do have a question before Santa arrives. I'm new with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.