note 66518 deleted from function.include by bjori
| From: | bjori@php.net | Date: | Thu, 25 May 2006 07:44:27 +0000 |
| Subject: | note 66518 deleted from function.include by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-112063@lists.php.net to get a copy of this message | ||
Note Submitter: AT-HE (at_he at h0tmai1 dot com)
Reason: useless
----
.
it seems you can include any text file with valid php syntax (including the <?php ?> flags),
not only *.php ones
it seems you can delete a file just once included
example:
---------------------------
<?php
$configfile="/path/to/configfile.cfg"; #not only php ones
if(file_exists($configfile)){
include $configfile;
unlink($configfile); # for security and data consistency
# now you can still do something
# with already included
# vars and functions
}else{
echo "config file not found!";
}
?>
------------------------
example
configfile.cfg:
-------------------------
<?php
$retries=5;
$datafile="/path/to/datafile";
function writeline($message){
echo $message."<br>\r\n";
}
?>
-------------------------
saludos :)
.