Hallo,
Ik heb een scriptje gemaakt, alleen als ik ?p=home doe, geeft hij de 404 pagina weer, en als ik ?p=home.php doe, laat hij wel de pagina zien. Ik wil juist dat hij het wel doet bij ?p=home.
Mvg,
Sebastiaanh
Ik heb een scriptje gemaakt, alleen als ik ?p=home doe, geeft hij de 404 pagina weer, en als ik ?p=home.php doe, laat hij wel de pagina zien. Ik wil juist dat hij het wel doet bij ?p=home.
[COLOR= #0000BB]<?php
$p[/COLOR] [COLOR= #007700]=[/COLOR] scandir[COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/unset"]unset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$p[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"{$_GET[p]}.php"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$p[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]].[/COLOR]php[COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]error/404.php[/COLOR][COLOR= #007700]);
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"pagina/{$_GET[p]}.php"[/COLOR][COLOR= #007700]);
}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"pagina/home.php"[/COLOR][COLOR= #007700]);
}[/COLOR]
?> Mvg,
Sebastiaanh





