Making it a function?



Hi,

I use the code below on my website, straight in the index page (not as a
function that is) and it works just fine.
But when I make it a function:
function LaadPagina()
{
// the code
}

put it in a seperate script, include it and next call the function:
LaadPagina();

It won't work, no page gets loaded, no PHP errors either.

Why won't it work when made in a function?

Cheers,
Samuel -code below -

<?php
$toegestaan = array("index", "doel", "gastenboek", "sponsors", "links",
"doel", "dagboek", "giften", "parcours", "contact", "fotoalbum");
$bestand = './pgn/' . $_GET['id'] . '.php';
if (in_array($_GET['id'], $toegestaan)) {
if (file_exists($bestand)) {
include($bestand);
} else {
$titel = '404 - Bestand niet gevonden.';
$kop = 'Ojee een 404 :(';
$inhoud = '<p>404 - Bestand niet gevonden.</p>';
}
} elseif (!isset($_GET['id'])) {
if (file_exists('./pgn/index.php')) {
include('./pgn/index.php');
}
} else {
header("HTTP/1.0 404 Not Found");
$titel = '404 - Bestand niet gevonden.';
$kop = 'Ojee een 404 :(';
$inhoud = '<p>404 - Bestand niet gevonden.</p>';
}
return $titel;
return $kop;
return $inhoud;
?>

But


.



Relevant Pages

  • Re: Manned Rheintochter missile?
    ... straight from here: ... What's especially funny with your claim that you don't know where it comes from is that if you feed in the first few words of the text you have, "During a dig at the Boeing Historical Archive," into Google, it takes you *right* to my webpage. ... But when you raid a guys website to butress your claims and then suggest that the guy whose website you raided doesn't know anything... ...
    (rec.aviation.military)
  • Re: Biker Grrrl Rosie
    ... What could have been a really interesting website was completely ruined ... permission to use the "Chitty Chitty Bang Bang" music, ... whether they're prepared to pay for permission to use the music. ... At least with Amazon and eBay you can see straight away what the total cost will come to. ...
    (uk.media.radio.archers)
  • Re: May Pangs reaction to Dateline
    ... > book ads) the letter of complaint to Dateline by Daytrippin' ... (documentaries on the Int'l Red Cross etc), ... retitled with something straight out of tabloid cover ... The DVD is reviewed on Steve Marinucci's abbeyrd website. ...
    (rec.music.beatles)
  • Re: Where is SWI-Prolog???
    ... Klaus Ruthmann wrote: ... > As i heard about a new release of swi-prolog in october, i went straight to ... > the website. ...
    (comp.lang.prolog)
  • Re: chronic grass sickness pony
    ... Hi Jill ... Great website - which I shall go ... straight back to to browse. ... I've spoken to the vet school in Edinburgh and read everything I can, ...
    (uk.rec.equestrian)