[HELP]Maintenance Page[HELP]

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

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?
 

DaLightz

See ya'll in the afterlife.
May 19, 2012
1,136
262
I'm quite sure that your Sql is a bit off.

instead of $sql = 'INSERT INTO `a1148371_roo`.`maintenance` (`status`) VALUES (\'".$status."\');';

Do $sql = mysql_query(INSERT SHIT);
 

Li1M0ST3Rz

I <3 Bianca
Sep 13, 2010
269
166
how to make index.php grab the database maintenance info? and how to make the admin directory maintenance.php to save it
PHP:
<?php
if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
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 = mysql_query(INSERT INTO `a1148371_roo`.`maintenance` (`status`) VALUES (\'".$status."\');
}
}
?>
<div id="content">
<div class="box">
<br />
  <table cellpadding="0" cellspacing="0" class="forms">
    <thead>
      <tr>
        <th colspan="2" class="left">Maintenance</th>
      </tr>
    </thead>
    <tfoot>
      <tr>
        <td colspan="2"></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></td>
      </tr>
 

Li1M0ST3Rz

I <3 Bianca
Sep 13, 2010
269
166
I'm quite sure that your Sql is a bit off.

instead of $sql = 'INSERT INTO `a1148371_roo`.`maintenance` (`status`) VALUES (\'".$status."\');';

Do $sql = mysql_query(INSERT SHIT);
i gotten an error when doing this:
You must be registered for see images attach


source:
PHP:
<?php
if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
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);
$sql = mysql_query(INSERT INTO `a1148371_roo`.`maintenance` (`status`) VALUES (\'".$status."\');
mysql_select_db(DB_DATABASE, $link);
}
}
?>
 

Users who are viewing this thread

Top