Help - Search - Members - Calendar
Full Version: How Does One "turn On" A Website?
BleepingComputer.com > Internet & Networking > Web Site Development
   
Glunn11
Hello BC! Man, it's been a while since I've last posted. Anyways, I'm currently expanding my knowledge of website scripting and programming by working on my website for a little school-related radio project I've set up.
Before I do the one-hour show, I must first edit the HTML to
1. Say we are LIVE
2. Connect to the server since it is a shared hosting place

I would like to be able to do this without having to edit the source code on the page each time. Is this possible (I'm thinking PHP may be able to)? Thanks ;)
groovicus
I am assuming by your question that you only want the website accessible at certain times during the day? And at all other times, not accessible? Does that mean not accessible at all? The only way you can do that is if you have access to the server. The server administration can allow or deny access to any of the websites it is hosting. Odds are that you do not have that sort of access though. If I were running a web-server, I wouldn't give anybody that acess.

The next option is to use PHP or something to dynamically create a web portal. When a user comes to the website, the php server checks to see what time it is and delivers the correct page based on the time. During normal operation, the user would get one page, during show times, a different page could be displayed, or some additional content on the main page, such as a link or something.

Alternatively, you could probably use javascript. Using the onload() function, one could use the javascript to see what time it is, and display one page or another, or add content to the main page not visible during normal hours.

The php way would be most useful if the hours of the radio show varied, because your PHP application could read from a simple text file to get the times that the show is to be broadcast. If you wanted to add, remove, or change times, all you would have to change was the text file. The downside is that you then need php capabilities on the server, and you need to code it in php.

The javascript way would work if the php option is not viable. Use an external .js page so that you do not have to alter your HTML.
Glunn11
Awesome, I think I should be able to roll with that. Thanks =)
Amazing Andrew
Just be sure to include a <noscript></noscript> section for those of us who switch off javascript on most sites (like me).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.