Connecting Tech Pros Worldwide Help | Site Map

pre-loader

  #1  
Old November 16th, 2006, 10:25 PM
Brian
Guest
 
Posts: n/a
Hi there

I'm not sure if this is a PHP or a Javascript problem, so sorry for the
cross post

I have a PHP page that talks to a MySQL page, i want to put in a "loading"
message.
I have tied to use a layer and using a showlayer at the top of the page and
hide
at the bottom, but it does not work, it still waits for the PHP to run.

I know it can be done, as i have seen it, how do they do that?

Brian



  #2  
Old November 17th, 2006, 08:55 AM
Martin Mouritzen
Guest
 
Posts: n/a

re: pre-loader


On Thu, 16 Nov 2006 22:40:08 GMT, "Brian" <not@given.comwrote:
Quote:
>Hi there
>
>I'm not sure if this is a PHP or a Javascript problem, so sorry for the
>cross post
>
>I have a PHP page that talks to a MySQL page, i want to put in a "loading"
>message.
>I have tied to use a layer and using a showlayer at the top of the page and
>hide
>at the bottom, but it does not work, it still waits for the PHP to run.
>
>I know it can be done, as i have seen it, how do they do that?
It seems like you're on the right track.

A common reason why it won't work is if you have mod_gzip enabled. You
can disable mod_gzip for a specific folder by having this in your
..htaccess

<IfModule mod_gzip.c>
mod_gzip_on Off
</IfModule>

You can see an example I made for a loading screen here:
http://siteloom.dk/~martin/loading/

--
best regards,
Martin Mouritzen.
http://www.siteloom.dk
  #3  
Old November 17th, 2006, 09:15 AM
J.O. Aho
Guest
 
Posts: n/a

re: pre-loader


Martin Mouritzen wrote:
Quote:
On Thu, 16 Nov 2006 22:40:08 GMT, "Brian" <not@given.comwrote:
>
Quote:
>Hi there
>>
>I'm not sure if this is a PHP or a Javascript problem, so sorry for the
>cross post
>>
>I have a PHP page that talks to a MySQL page, i want to put in a "loading"
>message.
>I have tied to use a layer and using a showlayer at the top of the page and
>hide
>at the bottom, but it does not work, it still waits for the PHP to run.
>>
>I know it can be done, as i have seen it, how do they do that?
>
It seems like you're on the right track.
>
A common reason why it won't work is if you have mod_gzip enabled. You
can disable mod_gzip for a specific folder by having this in your
.htaccess
>
<IfModule mod_gzip.c>
mod_gzip_on Off
</IfModule>
>
You can see an example I made for a loading screen here:
http://siteloom.dk/~martin/loading/
usage of mod_gzip is quite small nowadays and I don't think it's the problem
but the flushing of the output buffer in php.

Use ob_flush() to get out the data you want

<?php
/* header stuff and such */
....
/* head of HTML */
....
/* div for the waiting message */
....
/* javascript to enable div */
....
ob_flush();
/* do what you need to do with the mysql */
....
/* generate the rest of the page */
....
ob_end_flush();
?>

That could work for you, but I won't guarantee it will.


//Aho
  #4  
Old November 21st, 2006, 04:45 PM
Brian
Guest
 
Posts: n/a

re: pre-loader



"J.O. Aho" <user@example.netwrote in message
news:4s5e47Fu4ldtU1@mid.individual.net...
Quote:
Martin Mouritzen wrote:
Quote:
>On Thu, 16 Nov 2006 22:40:08 GMT, "Brian" <not@given.comwrote:
>>
Quote:
>>Hi there
>>>
>>I'm not sure if this is a PHP or a Javascript problem, so sorry for the
>>cross post
>>>
>>I have a PHP page that talks to a MySQL page, i want to put in a
>>"loading" message.
>>I have tied to use a layer and using a showlayer at the top of the page
>>and hide
>>at the bottom, but it does not work, it still waits for the PHP to run.
>>>
>>I know it can be done, as i have seen it, how do they do that?
>>
>It seems like you're on the right track.
>>
>A common reason why it won't work is if you have mod_gzip enabled. You
>can disable mod_gzip for a specific folder by having this in your
>.htaccess
>>
><IfModule mod_gzip.c>
>mod_gzip_on Off
></IfModule>
>>
>You can see an example I made for a loading screen here:
>http://siteloom.dk/~martin/loading/
>
usage of mod_gzip is quite small nowadays and I don't think it's the
problem but the flushing of the output buffer in php.
>
Use ob_flush() to get out the data you want
>
<?php
/* header stuff and such */
...
/* head of HTML */
...
/* div for the waiting message */
...
/* javascript to enable div */
...
ob_flush();
/* do what you need to do with the mysql */
...
/* generate the rest of the page */
...
ob_end_flush();
?>
>
That could work for you, but I won't guarantee it will.
>
>
//Aho


Thanks for your help guys, i will have a play and see what happens :)

Brian


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying code with <pre> Eric Lindsay answers 9 December 31st, 2005 01:15 PM
RegEx for changing linefeeds to <BR> except between <PRE></PRE> tags? Rocky Moore answers 7 November 18th, 2005 03:04 AM
img inside pre Jarno Suni not@here.invalid answers 8 September 18th, 2005 02:25 PM
Two <PRE> Selectors Buck Turgidson answers 2 July 21st, 2005 01:33 AM
stylesheet with several <pre> styles? Alan Illeman answers 7 July 21st, 2005 12:27 AM