note 61875 added to function.parse-ini-file
| From: | mauder | Date: | Tue, 14 Feb 2006 12:31:26 +0000 |
| Subject: | note 61875 added to function.parse-ini-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103683@lists.php.net to get a copy of this message | ||
Be careful if you put any .ini file in your readable directories, if somebody would know the name
(e.g. if your application is widely used), the webserver might return it as plain text.
For example : your database username and password could be exposed, if it is stored in that file !
To prevent this from happening :
- give the file .php extension : "my.ini.php"
- put ';<?php' (without quotes and without X between X and php) on first line
- put ';?>' on last line
The server would run the ini file as being PHP-code, but will do nothing due to bad syntax,
preventing the content from being exosed.
On the other hand, it is still a valid .ini file...
HTH !
----
Server IP: 194.109.193.119
Probable Submitter: 83.84.84.15
----
Manual Page -- http://www.php.net/manual/en/function.parse-ini-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61875
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61875&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61875&report=yes
Search -- http://master.php.net/manage/user-notes.php