简体   繁体   中英

How to protect php and folder files from unauthorized access?

  1. I want to block direct access to different php files (by writing let's say http://testpage.com/login_verif.php ), for example the login verification one (that authentificates users).
  2. Is it possible for an user to access the config.php file that connects him to the mysql database (and has the password written in it)?
  3. Also, how can you configure your uploads folder, so that an user can only see the image for which he has the URL?
  1. Exit the file if there is no data POSTed to the file, and/or place the file in a more controlled area .
  2. You should not have a config.php file - they are very much not safe, but instead environment variables .
  3. You may look into rewriting to disallow direct access , but allow referencing on the domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM