|
Posted by Shelly on 07/20/05 12:28
<bettina@coaster.ch> wrote in message
news:1121848541.353870.213250@g47g2000cwa.googlegroups.com...
>I want to understand exactly how it functions:
> Include_once search.php means that it will be included only once in
> index.php (supposing that index,php calls search.php.
>
> But what happens if I leave index.php, go for example to a subpage and
> come back again to index.php? Include_once will be executed again? I
> think so.
> I tried with a control question ...if (!isset($myvar) make the
> search.... It seems to work a little bit quickly.
>
The include_once means that the inline code is included only one time, even
if it is included as part of another code. In that sense it is the same as
the #include formulations in C, where each piece is given a name and you has
the include stuff inside an #ifndef statement.
What do you mean by "subpage". A page calls another page. When it comes
back the original page is executed so the include_once stuff, while included
only once, is re-executed. That is why putting inside the if (!isset
bybasses the reselect.
Shelly
[Back to original message]
|