flat file is just too insecure..
Offtopic: Hey edd![]()

flat file is just too insecure..
Offtopic: Hey edd![]()
doesnt work dude.I would simply do
maintanance.php
2hsus7sjs.php (has a funny name so no one will find it lol)PHP Code:<?php
$maintanance = file_get_contents("maintanance.txt");
if ( $maintanance == "true" ){
echo "site is offline";
exit();
}
?>
Not tested, should workPHP Code:<?php
if ( $_GET['action'] == "submit" ) {
$maintanance = $_POST['maintanance'];
$changefile = file("maintanance.txt");
$update = fopen($changefile , "w");
fputs($update , "$maintanance");
fclose($update);
}
?>
<form method="post" action="?action=submit">
<table>
<tr><td>Close?</td>
<td>
<select name="maintanance">
<option value="true" selected>Put site offline
<option value="false">Put site Online
</select>
</td></tr><tr><td colspan="2">
<center><input type="submit" value="change"></center>
</td></tr></table>
</form>
Also, it requires no database.
EDIT: allmost forgot lol, to make the script work add
to the index page of your site.PHP Code:<?php include("maintanance.php"); ?>
x
Lets set the stage on fire, and hollywood will be jealous.
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
SQL query:
CREATE TABLE `sitestatus` ( `id` INT( 2 ) NOT NULL AUTO_INCREMENT ,
`status` VARCHAR( 10 ) NOT NULL ,
`offmsg` TEXT NOT NULL ,
`onpage` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM INSERT INTO `sitestatus` ( `id` , `status` , `offmsg` , `onpage` )
VALUES ( '1', 'off', 'The site is currently offline for some much needed maintenance work on the frameworks!', 'http://www.radioaqua.net/'
)
MySQL said:![]()
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `sitestatus` (
`id` ,
`status` ,
`offmsg` ,
`onpage`
)
VALUES ' at line 9
I'm no MySQL Guru, someone help (A)
Couldn't edit the other one after 15 minutes.
Last edited by Independent; 31-05-2008 at 06:11 AM.
Id tell anyone to use this one.I would simply do
maintanance.php
2hsus7sjs.php (has a funny name so no one will find it lol)PHP Code:<?php
$maintanance = file_get_contents("maintanance.txt");
if ( $maintanance == "true" ){
echo "site is offline";
exit();
}
?>
Not tested, should workPHP Code:<?php
if ( $_GET['action'] == "submit" ) {
$maintanance = $_POST['maintanance'];
$changefile = file("maintanance.txt");
$update = fopen($changefile , "w");
fputs($update , "$maintanance");
fclose($update);
}
?>
<form method="post" action="?action=submit">
<table>
<tr><td>Close?</td>
<td>
<select name="maintanance">
<option value="true" selected>Put site offline
<option value="false">Put site Online
</select>
</td></tr><tr><td colspan="2">
<center><input type="submit" value="change"></center>
</td></tr></table>
</form>
Also, it requires no database.
EDIT: allmost forgot lol, to make the script work add
to the index page of your site.PHP Code:<?php include("maintanance.php"); ?>
you just copy and paste everything and then ChMOD maintanance.txt so it is 777 and it works.
There is nothing up with it.
![]()
Want to hide these adverts? Register an account for free!