473,226 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

loading screen

Hi all,

I've seen a really cool effect which i would like to use on an intranet
site. Am referring to the 'LOADING..' animation you see when switching
pages. I've seen it somewhere on a website that was using php (cant remember
the url). I've tried googling but came up with nothing - so does anyone know
what function of php allows to display a little animation while a sql query
is being run ?

Many thanks

T
Oct 25 '06 #1
5 10263
This effect can't be realised by only using PHP, since PHP is a
server-side language and the loading screen appears client side.
Yet, it is possible to achieve such an effect by using javascript and
CSS and having php invoke the necessary functions to enable/disable the
loading screen.

What you need to do is design the loading screen in css and hide it
initially. As soon as you start the section in php where the loading
screen is ment for, you send the html code to the client that invokes
the javascript function that displays the loading screen. Finally, at
the end of the php script, you send the invokation to the javascript
function that hides the loading screen again.

I hope this helps.

Oct 25 '06 #2

Laurent Haan wrote:
This effect can't be realised by only using PHP, since PHP is a
server-side language and the loading screen appears client side.
Yet, it is possible to achieve such an effect by using javascript and
CSS and having php invoke the necessary functions to enable/disable the
loading screen.

What you need to do is design the loading screen in css and hide it
initially. As soon as you start the section in php where the loading
screen is ment for, you send the html code to the client that invokes
the javascript function that displays the loading screen. Finally, at
the end of the php script, you send the invokation to the javascript
function that hides the loading screen again.

I hope this helps.
How about an animated gif.. but really.. do users want to see a loading
screen??

Flamer.

Oct 25 '06 #3
"Laurent Haan" <la**********@gmail.compíse v diskusním príspevku
news:11**********************@f16g2000cwb.googlegr oups.com...
This effect can't be realised by only using PHP, since PHP is a
server-side language and the loading screen appears client side.
Yet, it is possible to achieve such an effect by using javascript and
CSS and having php invoke the necessary functions to enable/disable the
loading screen.

What you need to do is design the loading screen in css and hide it
initially. As soon as you start the section in php where the loading
screen is ment for, you send the html code to the client that invokes
the javascript function that displays the loading screen. Finally, at
the end of the php script, you send the invokation to the javascript
function that hides the loading screen again.
Other way is to place small image eg. 10x1 pixel to page and into very long
html content time by time put javascript for resizing image width. Some like
this:

<html>
<head>
<script>
function resizeit(x) {
image=getElemtById("bar");
image.width=x;
}
</script>
</head>
<body>
Loading: <img id="bar" src="some_green_image.gif" height=10 width=1>
<p>...some long html content here</p>
<script>resizeit(5)</script>
<p>...some other long html content here</p>
<script>resizeit(10)</script>
....
<script>resizeit(100)</script>

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Oct 26 '06 #4
Laurent Haan wrote:
As soon as you start the section in php where the loading
screen is ment for, you send the html code to the client that invokes
the javascript function that displays the loading screen. Finally, at
the end of the php script, you send the invokation to the javascript
function that hides the loading screen again.
This won't work because PHP is server-side and javascript is
client-side. NONE of the client-side js code will be executed on the
browser until all of the PHP code has executed. Basically, you won't
get a "loading" message until the job is already "loaded"
This effect can't be realised by only using PHP...
That is not entirely true. You can make use of the php output buffer.
Keep in mind this is only a viable option when you're running multiple
PHP commands iteratively. For instance, say you're running a series of
PHP queries, such as inserting a master record which returns some
result details, then inserting records into multiple child tables, each
having some sort of result detail returned.

You can append the *result detail* stuff to the output buffer, while
echoing out the approximate change in percent completed. Once all the
SQL tasks are completed, you then dump out the buffer. This is
especially useful for transactional queries where everything rolls back
if something fails. The first link below has a pretty good example.

http://usphp.com/manual/en/function.ob-end-clean.php

http://us2.php.net/manual/en/function.ob-start.php

http://us2.php.net/manual/en/functio...t-contents.php

Oct 26 '06 #5
toffee wrote:
Hi all,

I've seen a really cool effect which i would like to use on an intranet
site. Am referring to the 'LOADING..' animation you see when switching
pages. I've seen it somewhere on a website that was using php (cant remember
the url). I've tried googling but came up with nothing - so does anyone know
what function of php allows to display a little animation while a sql query
is being run ?
Redirection with delay, take a look at the header() function documentation,
this can also be done with meta tags in pure html too.

http://www.php.net/manual/en/function.header.php
//Aho
Oct 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill K | last post by:
I am developing a winforms project in vb.net. I have several forms that have a number of controls, grids, etc. When I load these as MDI child forms, they load slowly AND they paint/repaint on the...
17
by: Aguilar, James | last post by:
My previous example used the concept of a Shape class heirarchy, so I will continue with that. Suppose I have something like fifty different shapes, and I am trying to instantiate one of them. ...
6
by: Curious George | last post by:
I have a page that takes about 10 seconds to load the first time it is run. I would like to first display a little animated gif telling the user that the page is loading. How do I do this with...
8
by: Terry | last post by:
I am loading a javascript function from my asp.net app. This function loads a string passed to it in a new window. I register the function to activate on click of an asp linkbutton. Now when...
1
by: alex | last post by:
Hi, I am loading quite a large list into a datagrid and while doing so the form freezes... and for 10-20 seconds i have quite a messy screen. e.g. the file chooser half deleted and still half...
3
by: Maileen | last post by:
Hi, I have a module in which are define 2 forms as below : '------ Module Module1 Public MyMain As New FMain Public MySplash As New FSplash Public Sub Main() MySplash.Show()
0
by: vinayakk | last post by:
Hello webies, I have a problem with loading html pages in frameset. I am using location.href to load html pages one by one upon the user request and these pages in turn load flash files. When one...
8
by: Mark Shroyer | last post by:
I just completed a new design for a personal web site. After finishing the basic CSS stuff and double-checking it in Safari, FF, Opera, et al., I put on my war paint and fired up IE7 to figure out...
3
by: codyshea2000 | last post by:
how would i make text dissapear then the text on that page apears all on the same page i know how to make text dissapear like this <div id="helpdiv" style="display:block"> Loading... </div> ...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.