I need a script.

Status
Not open for further replies.

shaheemz

Member
Feb 4, 2012
30
5
Can someone make a script for me?
So i can turn "maintenace mode" on or off. (Via database or site idc)

And you cant go to any page if "maintenace mode" is on.

Please help ;)
And i'l like + rep u.
 

xHissy

PHP / VB.net Developer
Oct 23, 2011
75
5
Try
PHP:
<?php
$siteinfo = mysql_query( "SELECT * FROM `site_info`" );
$sinfo = mysql_fetch_assoc( $siteinfo );
if ($sinfo['maint'] == "1"){ '// 1 = Offline, 0 = Online
header ("offline.php");
}
?>

You would have to make a universal header that is used on all pages or put this on top of all pages.

The code does, Look at the table "site_info" for the field "maint" and check what its value is.

You probably need to change the "site_info" and "maint" and this code has to be below your DB connect.

Enjoy :)
 
Status
Not open for further replies.

Users who are viewing this thread

Top