There is a code and in it other files, templates are attached. In a certain part of the code, in the condition, I need to disable this very inclusive and is it possible to do this? There is a way to create a new file, but I would like everything to be in one file.
- 3what a crazy question? If the software is written in the condition, then the files are also connected by condition. Did someone need this !? you can disable incloud without invoking incloud itself. - Artem
- Inklyu connected out of condition - rimlin
- So connect them in conditions and there is no problem. if ($ all_okey) include ("my.inc"): - ReinRaus
- oneYou can no longer unload the connection, in a certain place where you have any conditions for not connecting, set the global flag, and in the place of the connection check this flag. - ReinRaus
- one> Inklyu connected out of condition If so connected then the hell off. Make your conditions and connect as needed. - Artem
|
1 answer
If include
used then it is simply loaded inserted into the code instead of itself for example:
File p1.php
:
$df="fef"; function somefunc(){...}
Main file:
include p1.php; $s=5;
then the executable result will be:
$df="fef"; function somefunc(){...} $s=5;
and accordingly nothing can be rolled back but you can replace:
File p1.php
:
$df="fef"; function somefunc(){//определение1...}
Main file:
include p1.php; $df=NULL; function somefunc(){return NULL;}
then the executable result will be:
$df="fef"; function somefunc(){...} $df=NULL; function somefunc(){return NULL;}
Then the result of connecting the file can be “blocked”. It is also better to use require
instead of include
. The first one does not return errors if it cannot connect the file. And it is even better to use require_once
. after "overlapping" your code, other connection lines of the same file will not block your lines again
|