Li1M0ST3Rz
I <3 Bianca
- Sep 13, 2010
- 269
- 166
i need help to code a maintenance.php first i coded a maintenance drop box on admin directory
and on index.php root directory its a bit private but:
this is incomplete, what i tried to do on admin directory maintenance on and off drop down connect to the database as you can see it look crappy code, then index.php $maintenance connect to database maintenance table.
could someone can help me?
PHP:
<?php
if (isset($_POST['Submit'])) {
$status = explode("\r\n", $_POST['url']);
// let's create the INSERT query
$values = array();
foreach ($status as $status) {
$link = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
mysql_select_db(DB_DATABASE, $link);
$sql = 'INSERT INTO `a1148371_roo`.`maintenance` (`status`) VALUES (\'".$status."\');';
}
}
?>
<div id="content">
<div class="box">
<h1>Maintenance</h1>
<div class="box-content">
<center>
<form name="status" action="" method="POST">
<div align="center">
<select name="status">
<option value="0">On</option>
<option value="1">Off</option>
<input type="submit" value="Now" name="submit">
</select>
</div>
</form>
</center>
</div>
</div>
</div>
</div>
and on index.php root directory its a bit private but:
PHP:
<?php
if (!defined("_VALID_PHP"))
die('Direct access to this location is not allowed.');
$news = $core->renderNews();
$maintenance = "1";
if ($maintenance == "1") {[
include 'maintenance.php';
die;
}
?>
this is incomplete, what i tried to do on admin directory maintenance on and off drop down connect to the database as you can see it look crappy code, then index.php $maintenance connect to database maintenance table.
could someone can help me?