1.

Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use?(a) open_dir = “/home/www/”(b) open_dir = /home/www/(c) open_basedir = /home/www/(d) open_basedir = “/home/www/”The question was asked in unit test.The query is from Website Security using PHP topic in chapter File and Session Handling in PHP of PHP

Answer»

Right ANSWER is (d) open_basedir = “/home/www/”

For EXPLANATION: We can use open_basedir statement to define the PATHS from which we can ACCESS files using functions like fopen() and gzopen(). It is used to PREVENT users from viewing and manipulating files such as /etc/password.



Discussion

No Comment Found

Related InterviewSolutions