Posted by Geoff Berrow on 02/01/07 13:39
Message-ID: <Klgwh.2288$4H1.1860@newssvr17.news.prodigy.net> from
Sanders Kaufman contained the following:
>No - and you may find this weird.
>An include/require will be included no matter what.
>
>For example:
><? php
>if(TRUE){
> include "myfile.php";
>} else {
> include "yourfile.php";
>}
>?>
>
>In the above example - BOTH files will be included no matter what.
Not quite sure what you are saying here as this clearly is not the case
in practice.
http://www.ckdog.co.uk/test/includes.php
<a href='includes.php?file=f1'>file one</a> | <a
href='includes.php?file=f2'>file two</a><br><br>
<?php
if(isset($_GET['file'])&& $_GET['file']=="f1"){
include("f1.php");
}
elseif(isset($_GET['file'])&& $_GET['file']=="f2"){
include("f2.php");
}
else{
echo "No file included";
}
?>
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|