Jordyvc schreef:Mijn eerste mini simpel scriptje in phpEen onderhoud scriptje
[COLOR= #0000BB]<?php
$onderhoud[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]true[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Zet "true" als de onderhouds pagina moet werken. Zet "false" als er geen onderhoud is![/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Hallo wij zijn momenteel in onderhoud! Kom later maar eens terug![/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Onderhouds bericht.[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$onderhoud[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]false[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//website hier[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Probeer op je uitlijning te letten! Dat was een fout die ik ook maakte in het begin, het wordt echt onoverzichtelijk zo.
Ik zou het zo doen:
[COLOR= #0000BB]<?php
$onderhoud[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]true[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Zet "true" als de onderhouds pagina moet werken. Zet "false" als er geen onderhoud is![/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Hallo wij zijn momenteel in onderhoud! Kom later maar eens terug![/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Onderhouds bericht.[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$onderhoud[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]false[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//website hier[/COLOR]
[COLOR= #007700]}[/COLOR]
?> // ingekort
Een onderhoud scriptje 

41:

13: