robert_gsfame Posted November 5, 2009 Share Posted November 5, 2009 Let say i click on http://www.mydomain.com/ ...and i need to wait for 5 seconds before index.php opened. Can i have some words shown up like this: " Please Wait while we redirect you to the page..." How to do it?? thx in advance Link to comment https://forums.phpfreaks.com/topic/180409-solved-loading-shown-up-when-loading-a-page/ Share on other sites More sharing options...
Bricktop Posted November 5, 2009 Share Posted November 5, 2009 Hi robert_gsfame, It would be better to achieve this result using Javascript. Have a look at this article which explains how to achieve this result using JQuery. Another very simple option would be to. 1. Create a page called "redirect.html" and add the following code: <p>Please wait while the page loads</p> <meta http-equiv="refresh" content="5;url=http://www.mydomain.com"> 2. Edit your .htaccess file and add the following: DirectoryIndex redirect.html However, this option will always wait 5 seconds, by then the page may not have loaded, or it may have loaded in 2 seconds and the user still has to wait. It also may effect SEO ratings so I would recommend you investigate the Javascript option as this is dynamic and the loading dialog will clear once the page has finished loading. Hope this helps. Link to comment https://forums.phpfreaks.com/topic/180409-solved-loading-shown-up-when-loading-a-page/#findComment-951763 Share on other sites More sharing options...
mrMarcus Posted November 5, 2009 Share Posted November 5, 2009 do you actually "need" it to wait before it continues to the next page, or do you just like the way that looks? 'cause, if you don't actually need to have the user spend 5 seconds waiting, don't bother. but, if you must, use 'meta refresh': <meta http-equiv="refresh" content="5;url=http://www.example.com/page-to-redirect-to.html" /> that goes in your <head>...</head>, and then just have whatever text you like on the page. but honestly, if you don't actually need to keep a user waiting, don't. or at least give them the option to 'click to continue' or something. and if you are referring to "Loading..." as you might see in Gmail or something similar, that because it's actually loading something using AJAX, it's not just for show. Link to comment https://forums.phpfreaks.com/topic/180409-solved-loading-shown-up-when-loading-a-page/#findComment-951766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.