Building a loading Screen

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ihateevilbill
Forum Commoner
Posts: 29
Joined: Fri Nov 14, 2003 5:57 am

Building a loading Screen

Post by ihateevilbill »

Hello again peeps,

What I wanna do is display a gif whilst curl is working, then hide it (using display:none or a php equivalent if possible) but I am having problems getting the bugger to hide again.

What I have so far is as follows (pseusocode):

Code: Select all

Show Header Images
If post > 0 (in other words there are post fields)
 show picture;
End if

Main html with form code etc

If post > 0 (see above)
 do curl statements;
 hide picture; - This is the line I cant work out
 display curl output;
end if
I can post the code if you think it would be easier to visualise what I am doing. Needless to say the image is showing after I click the submit button on my form, cURL is also sending the xml request, getting the XML response and then displaying it. Just cant work out how to hide the damned gif now :P

Thanks for all yer help,

Me
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if you like it simple

Code: Select all

<html>
	<head>
		<title>lalala</title>
	</head>
	<body>
		<img src="imgs/green.png" id="processIndicator" style="visibility: visible;"/>
<?php
flush();
// something that takes quite a while
sleep(2);
?>
		<script type="text/javascript">
			var objImg = document.getElementById('processIndicator');
			if (objImg != null)
				objImg.style.visibility = "hidden";
		</script>
	</body>
</html>
Post Reply