indiodoido Posted August 27, 2007 Share Posted August 27, 2007 hi... I've created a new site, and its going to be online in September. Until then, i would like to have online a simple countdown that will display the time left until that day, and when we reach that date the new web page would appear automatically. Can anyone help me? Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/ Share on other sites More sharing options...
trq Posted August 27, 2007 Share Posted August 27, 2007 If its a countdown you want, its Javascript you require. Not PHP. Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335419 Share on other sites More sharing options...
indiodoido Posted August 27, 2007 Author Share Posted August 27, 2007 but with javascript anyone can see the link of the new website, and with php it would no be possible. isn't it possible to create a countdown with php ?? Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335421 Share on other sites More sharing options...
dbo Posted August 27, 2007 Share Posted August 27, 2007 Yeah you could pull this off. Though I think its significantly more work than it's worth and would require a mix of javascript and PHP to get the desired effect. Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335426 Share on other sites More sharing options...
kathas Posted August 27, 2007 Share Posted August 27, 2007 it is not safe to have the website accessible before it goes public anyway, it doesn't matter that there will be no link to the other pages they can still be found by luck or patience. Just have the site off the server or protect it using .htaccess (if on Apache) and if you want the site to go public automatically just add a cron job and run a script that will do it... And the count down must be made with JavaScript or any form of client side scripting... Kathas Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335437 Share on other sites More sharing options...
indiodoido Posted August 27, 2007 Author Share Posted August 27, 2007 humm, i see... i thought it would be easier :-( ok, no problem, maybe i will just use a simple javascript countdown and then upload the website manually, much more secure ;-) thanks for the tip guys Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335450 Share on other sites More sharing options...
lightningstrike Posted August 27, 2007 Share Posted August 27, 2007 Perhaps write a simple script to include at the top of the pages. e.g $openat = mktime(1,0,0,9,1,2007); // 1 AM, September 1st, 2007 read more at php.net/mktime $javascript = "<br> <script type=\"text/javascript\"> //put some code here for javascript countdown. </script> "; if(time()<$openat){ die("The website will open on: " . date("M d Y",$openat) . $javascript); } Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335457 Share on other sites More sharing options...
dbo Posted August 27, 2007 Share Posted August 27, 2007 Or.... just create a generic html page with javascript that says page will be online at this time. Keep the real site offline and then just upload it before that date... take down the generic index page and let the live site chug when you're ready. Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335459 Share on other sites More sharing options...
lightningstrike Posted August 27, 2007 Share Posted August 27, 2007 Well actually if he/she has access to the php.ini file or even setting a htaccess php_flag. All they would have to do is make a file I described then simply edit the value of auto_append_file to the file handling the auto-opening. Quote Link to comment https://forums.phpfreaks.com/topic/66907-show-website-at-a-specific-date-and-time/#findComment-335461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.