Hi,
I decided to place the question under General since I am open to any code or idea. I am building a site and I need to be able to work on it without shocking readers with all the "surgery" going on. I need an easy yet safe recommendation for a login prompt when the site is under maintenance.
In other words, each time I need to work on the site just insert a line of code to show a screen to visitors that says the site is under maintenance and a login prompt (of course inserting the correct login will allow me to view the site and work on it). I have no problem with the css but rather javascript or php. Appreciate any help I can get and thank you for reading.
What you probably need is some sort of "splash" page.
A splash page is a sort of preview of the site, often with an "Enter Site" button somewhere obvious.
You can have a splash page where you can add a line for maintenance.
<?php
$maintenance = 0; // set to 1 while under maintenance
if($maintenance == 1){
header("location: login.php");
} else {
header("location: home.php");
}
exit;
?>
Note that this solution isn't perfect, and it's extremely basic, so it should only be used for a small site.
I was in the same situation before.
My site was in php so I used this code:
<?php
included 'isDebugOn.php';
if ($debug) {
echo "Site Is Temporarily Unavailable";
else {
//regular site code
}
?>
the advantage with this code is that you can just change the $debug variable in isDebugOn.php and to update the site.
Bookmarks