lolwut
25-03-2007, 08:54 AM
My first ever peice of PHP coding. Please be constructive when criticising it :)
Sorry I didn't really know where this is supposed to go. If it's in the wrong place can a Mod move it?
Page: index.php
<?php
$sitestat = "off"; //Change this to on or off. NOTE: Chaning it to something other than on or off will result in the user not being able to access the site, even if it's on!
if ($sitestat == "off") {
echo "<font color=\"Red\" size=\"3\" face=\"Verdana\">Site Offline!</font>"; // Only bit you need to edit.
} elseif ($sitestat == "on") {
echo "<font color=\"Green\" size=\"3\" face=\"Verdana\">Site Online.
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=main.php\"></font>"; // Only bit you need to edit.
} else {
echo "Sorry, your admin didn't set the status for the website... The valid statuses are <b>off</b> and <b>on</b>.";
}
//------------------------------------------------------------------------------------//
// Edit what I told you not to edit (if you don't know PHP). The script may not work! //
//------------------------------------------------------------------------------------//
?>
Sorry I didn't really know where this is supposed to go. If it's in the wrong place can a Mod move it?
Page: index.php
<?php
$sitestat = "off"; //Change this to on or off. NOTE: Chaning it to something other than on or off will result in the user not being able to access the site, even if it's on!
if ($sitestat == "off") {
echo "<font color=\"Red\" size=\"3\" face=\"Verdana\">Site Offline!</font>"; // Only bit you need to edit.
} elseif ($sitestat == "on") {
echo "<font color=\"Green\" size=\"3\" face=\"Verdana\">Site Online.
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=main.php\"></font>"; // Only bit you need to edit.
} else {
echo "Sorry, your admin didn't set the status for the website... The valid statuses are <b>off</b> and <b>on</b>.";
}
//------------------------------------------------------------------------------------//
// Edit what I told you not to edit (if you don't know PHP). The script may not work! //
//------------------------------------------------------------------------------------//
?>