snippet library logo
in category
PHP / Misc / Simple Site Switch (On/Off)
Snippet details
ID: 516
Viewed: 2953
Added: 2003-11-03
Version: 1.0
Sorry no demo

User Rated at: 4 Stars
Rate This:
Snippets in this catagory         
Show Printable Version
This really simple bit of code will display a custom message if a variable is set to Off or display your HTML code if it's set to On.

General Details
Snippet uploaded by: Martyn Coupland
Email : webmaster@windowsforums.net
Snippet By: DA Master

<!---Head--->
<?php

/* status.php is simply a variable with On assigned as a default variable, you can change this to Off to make your site offline. Copy the code below and save it to status.php:

<?php

$status = "On"; // Change to Off to make site offline

?>

Before uploading this remove all the comments above */

include("/path/to/status.php"); // Include the file with the status

if($status == 'Off'// If the status is Off then show this
{
    echo 
"Site is currently offline";
} else
?>

<!---Body--->


<!-- HTML CODE HERE -->

<?php ?>




No Reviews to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.