Li1M0ST3Rz
I <3 Bianca
- Sep 13, 2010
- 269
- 166
How to make an Maintenance
Requirements:
- Xampp or webhost
- NotePad ++
- ME!
Now Starting:
Now lets go to mysql on my xampp
create a table name: maintenance and number of columns: 1 and press go!
then the table should load up.. now name: status type: INT & Default: 1(1 = on, 0 = off) and now save!
now lets start coding!
config.php:
on Index or header put this on top:
then on Admin Panel create a Maintenance page, and add this:
Then there you had created a an index that lead to maintenance
now you have to make a maintenance at the root of the file!!
My SupremeCMS maintenance.php:
This code is in SupremeCMS
if it dont work add id on table and make it primary.
and fix this:
Requirements:
- Xampp or webhost
- NotePad ++
- ME!
Now Starting:
Now lets go to mysql on my xampp
create a table name: maintenance and number of columns: 1 and press go!
then the table should load up.. now name: status type: INT & Default: 1(1 = on, 0 = off) and now save!
now lets start coding!
config.php:
PHP:
<?php
mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
?>
on Index or header put this on top:
PHP:
<?php
include 'config.php';
$result = mysql_query("SELECT * FROM maintenance");
while($row = mysql_fetch_array($result))
if($row['status'] == 0):
header("Location: ./maintenance.php");
endif;
?>
then on Admin Panel create a Maintenance page, and add this:
PHP:
<?php
if(isset($_GET['save'])): {
$status = $_POST['status'];
include './config.php';
$query = "UPDATE maintenance SET status='". $status ."'";
$result = mysql_query($query);
endif;
}
?>
<form name="status" action="maintenance.php?save" method="POST">
<div align="center"></div>
<tr><th>
<input type="text" name="status" />
<input type="submit" value="Now" name="submit"></th></tr>
</select>
</form>
Then there you had created a an index that lead to maintenance
now you have to make a maintenance at the root of the file!!
My SupremeCMS maintenance.php:
This code is in SupremeCMS
if it dont work add id on table and make it primary.
and fix this:
PHP:
<?php
if(isset($_GET['save'])): {
$status = $_POST['status'];
include './config.php';
$query = "UPDATE maintenance SET status='". $status ."' WHERE id='1'";
$result = mysql_query($query);
endif;
}
?>
<form name="status" action="maintenance.php?save" method="POST">
<div align="center"></div>
<tr><th>
<input type="text" name="status" />
<input type="submit" value="Now" name="submit"></th></tr>
</select>
</form>