bulgaria_mitko Posted March 5, 2007 Share Posted March 5, 2007 the idea is a script that loads when a large page is trying to open that need for example 5-6 mins to load and in the mean time to open a very small page that is saying loading the page please wait and when the large page is loaded to go directly to that page. Do u get my idea? Thank you very much! Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/ Share on other sites More sharing options...
gazever Posted March 5, 2007 Share Posted March 5, 2007 5-6 minutes, what type of page would take that long? Flash? Perhaps open a popup when the page opens, like what they do when getting online car insurance quotes, checking flights etc. Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199826 Share on other sites More sharing options...
bulgaria_mitko Posted March 5, 2007 Author Share Posted March 5, 2007 no its not 5-6 mins, i lie of course lol, but it takes quite a long time. and thank you for the suggestion! any others? Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199829 Share on other sites More sharing options...
redarrow Posted March 5, 2007 Share Posted March 5, 2007 sleep(1); http://uk2.php.net/sleep Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199830 Share on other sites More sharing options...
benjaminbeazy Posted March 5, 2007 Share Posted March 5, 2007 most browser display page content as it loads, you can put a message at the top of the page if you want a page that loads with a loading message and nothing more, then displays the page when its done, you can use a little js and css at the end of the large page code to swap displaying blocks ie include both pages block 1(visible):loading message block 2(hidden):large page end of large page: js swap display of blocks the js wont load until large page has finished rendering Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199832 Share on other sites More sharing options...
bulgaria_mitko Posted March 5, 2007 Author Share Posted March 5, 2007 hey, enjaminbeazy, im not very good in js, can u give me an example? what if the big page is http://movies.yahoo.com/ and the page that i want to display white page is rendering this text: loading message how do u do that? ??? Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199835 Share on other sites More sharing options...
redarrow Posted March 5, 2007 Share Posted March 5, 2007 You header redirect the user to a page with a rotating gif then sleep for 6 min then send them back to the information ok. Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199840 Share on other sites More sharing options...
bulgaria_mitko Posted March 5, 2007 Author Share Posted March 5, 2007 and the page will still loads in the background right? can u write me a simple code for an example? i will be very thankful, I'm beginner in php! Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199850 Share on other sites More sharing options...
Snooble Posted March 5, 2007 Share Posted March 5, 2007 dont use sleep. It has many problems. Just use a meta refresh... <meta http-equiv="refresh" content="10; URL=pagetoredirectto.php"> content is where you place the seconds to wait. that one waits 10 seconds and send to "pagetoredirecto.php" Snooble Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199852 Share on other sites More sharing options...
redarrow Posted March 5, 2007 Share Posted March 5, 2007 Tll me more about the problam with sleep please cheers? Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199858 Share on other sites More sharing options...
benjaminbeazy Posted March 5, 2007 Share Posted March 5, 2007 the problem with those solutions are that they aren't accurate as to how long it takes to load the file someone on a cable line will load it way faster than 56k and have to wait just as long put this in head, im not too keen on javascript so i would make a 1x1 image at bottom of large file included to use onload event handler <script type="text/javascript"> function change(id){ ID = document.getElementById(id); if(ID.style.display == "") ID.style.display = "none"; else ID.style.display = ""; } </script> <div id="1"> Please wait while the page loads... </div> <div id="2" style="display:none"> include large file here <img src="whatever" onLoad="change(1)"> <img src="whatever" onLoad="change(2)"> </div> like i said, i don't know jack about javascript really so you can look up js event handlers and figure out how to combine the function calls and use a better loading schema Link to comment https://forums.phpfreaks.com/topic/41247-is-there-a-script-to-open-a-small-page-when-loading-a-large-page/#findComment-199861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.