Re: Also... Re: PHP includes question
Geoff Berrow wrote:
This doesn't really disprove Sanders' point: both files may have been
included, but only one output to the browser -- the other one may have
simply been parsed and ready.
That said, I believe the behaviour Sanders describes was changed with
PHP 4. include()ed and require()ed files are now only loaded on demand.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Geoff Berrow wrote:
<a href='includes. php?file=f1'>fi le one</a| <a
href='includes. php?file=f2'>fi le 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";
}
>
?>
href='includes. php?file=f2'>fi le 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";
}
>
?>
included, but only one output to the browser -- the other one may have
simply been parsed and ready.
That said, I believe the behaviour Sanders describes was changed with
PHP 4. include()ed and require()ed files are now only loaded on demand.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Comment