[PHP] Website offline script

Gestart doorSdejong26 reacties49 weergaven

27 berichten · pagina 1 van 2

Sdejong

Lid · Topicstarter

Berichten
1.226
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heej!

Ik ben opzoek naar een script waarmee je met éen knop je hele website offline gooit smile
Groet,
Steven
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Zoek ik ook yummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik had ereen
aleen die ben ik nu kwijt
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat bedoel je met offline? Dat er een tekst verschijnt zoals: We hebben de website tijdelijk offline gegooid of dat de website niet geladen kan worden?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ze bedoelen script
dat als er 1 word neergezet is ales online
als er 0 word neer gezet
dan word onderhoud.php geincluded
0
Sdejong

Lid · Topicstarter

Berichten
1.226
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat Nielsie zegt smile
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
config.php

[COLOR= #0000BB]<?php
$onderhoud[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]1[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// 1 voor onderhoud, 0 voor normaal[/COLOR]
?>


pagina.php

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700])[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$onderhoud[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700])[/COLOR] 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]We zijn momenteel in onderhoud[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    [COLOR= #FF8000]// de rest van de index[/COLOR]
[COLOR= #007700]}[/COLOR]

?>


Het word iets in die richting denk ik, maar met die knop moet je zelf even kijken.

En ik ben nogal slecht in php, dus sta niet raar te kijken als ie niet werkt.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[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/echo"]echo[/URL] [COLOR= #DD0000]De website is tijdelijk offline[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Of include(onderhoud.php);[/COLOR]
    [COLOR= #007700]}[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
   [COLOR= #007700]{[/COLOR]
       [COLOR= #FF8000]//Rest van index.php[/COLOR]
    [COLOR= #007700]}[/COLOR]
?>


Zoiets?
0
Sdejong

Lid · Topicstarter

Berichten
1.226
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ze werken allebei niet sadley. Wel bedankt voor je inspanning ! smile
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
emoJe moet ook eerst een tabel maken en connecten met je database
0
Sdejong

Lid · Topicstarter

Berichten
1.226
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja dat zag ik ook,, Maar ik kan geen Tabellen maken ..
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon via phpmyadmin
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Config.php

[COLOR= #0000BB]<?php
    $connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]localhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]####[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]###[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]###[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 

    [COLOR= #0000BB]$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/echo"]echo[/URL] [COLOR= #DD0000]De website is tijdelijk offline[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Of include(onderhoud.php);[/COLOR]
        [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();[/COLOR] [COLOR= #FF8000]// Zorgen dat er verder echt niets meer uitgevoerd kan worden.[/COLOR]
    [COLOR= #007700]}[/COLOR]
?>


CREATE TABLE IF NOT EXISTS config (
status tinyint(1) DEFAULT 1
);


Zoiets, en dan include je config gewoon op elke pagina (behalve onderhoud.php als je deze laat includen als status op 0 staat!!!)
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waarom doe je geen text ipv tinyint
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Werkt niet bij mij confused
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in /home/fskpro/domains/fskproductie.nl/public_html/config.php on line 5
De website is tijdelijk offline
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren