Hallo,
In een functie check ik of er is ingelogd.
Hier de functie (voorbeeldje, ff snel gemaakt)
Hoe kan ik een die() returnen met tekst én een include() in een functie?
Alvast bedankt.
In een functie check ik of er is ingelogd.
Hier de functie (voorbeeldje, ff snel gemaakt)
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] check_login[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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Je bent niet ingelogd![/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]nietingelogd.php[/COLOR][COLOR= #007700]));[/COLOR] [COLOR= #FF8000]// Zo lukt het niet[/COLOR]
[COLOR= #007700]}
}[/COLOR]
?> Hoe kan ik een die() returnen met tekst én een include() in een functie?
Alvast bedankt.
je kan ook gewoon exit(hoi); of die; doen 

