php command if in htaccess

Gestart doorBartv9 reacties56 weergaven

10 berichten · pagina 1 van 1

Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan ik de php command if in htaccess gebruiken?
zoja hoe?
ik wil zeg maar doen:

if($fetch[onderhoud] == 1)
{
DirectoryIndex onderhoud.html
}
else
{
DirectoryIndex index.php
}


of is hier een andere manier voor?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit kan niet...

Je kunt het beste gewoon een onderhoud.php maken, en die altijd als DirectoryIndex zetten..
dan zet je in onderhoud.php dit:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderhoud[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]onderhoud.html[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]index.php[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Of je zet dit in je index.php:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderhoud[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]onderhoud.html[/COLOR][COLOR= #007700]);
}[/COLOR]
?>


Dan hoef je ook niet met DirectoryIndex te gaan klooien
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderhoud[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])[/COLOR]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]bestand.php[/COLOR][COLOR= #007700]));[/COLOR]
?>


Is koning
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Komt op hetzelfde neer als wat ik zei emo
0
Miel

Lid

Berichten
4.462
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Korte notatie is bad.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Miel schreef:
Korte notatie is bad.
Why? :0
0
Miel

Lid

Berichten
4.462
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Volledig is overzichtelijker.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik vind het zo ook duidelijk hoor
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maar als je het zoals ik doet, kan je als hij in onderhoud is gewoon naar de index.php gaan. En ik dacht dat hij dat wilde biggrin
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