je moet in phpmyadmin nog op invoegen klikken
kan je ook doen
INSERT INTO `config` (`status`) VALUES
(1); kan je ook doen
INSERT INTO `config` (`status`) VALUES
(1);
maar bedankt niels.[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"beveiliging.php"[/COLOR][COLOR= #007700])[/COLOR] ?>
<FORM METHOD="post" ACTION="">
<SELECT NAME="status">
<OPTION VALUE="" SELECTED>----> onderhoud <----</OPTION>
<OPTION VALUE="0">open</OPTION>
<OPTION VALUE="1">dicht</OPTION>
</SELECT>
<INPUT TYPE="submit" NAME="verzend" VALUE="update">
</FORM>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700])[/COLOR] ?> 


Rik schreef:Bedankt@ Shahiem: omdat je alleen het numer 0 of 1 hoeft op te slaan. Dus dan moet je een kleine int gebruiken
, Dan weet ik dat ook weer
Remcoboy schreef:Maardan dat deze index.php heet en hij wordt doorgestuurt naar index2.php als hij online is.Ik zoek hetzelfde,
[COLOR= #0000BB]<?php
$config[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT status FROM config"[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$config[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]status[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]onderhoud.php[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/header"]header[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]index2.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//// als die niet werkt echo <meta http-equiv="refresh" content="0;URL=index2.php" />;[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Boude schreef:Anders moet je telkens dat ding include Of kun je dat ook in je config zetten?Maar kijk als je dan naar aanmelden of zo gaat dan kom je er als nog! dat moet toch exit; Of zo wat rik had gedaan?
$ip = $_SERVER[REMOTE_ADDR];
$config = mysql_result(mysql_query("SELECT status FROM config"), 0);
if($config[status] == 0 || $config[ip] == $ip)
{
echo <meta http-equiv="refresh" content="0;URL=onderhoud" />;
}
.. De ip is van mij! En als ik naar onderhoud ga dan reffrest hij die pagina de heletijd!