PHP - Prevent direct access to php file


/ Published in: PHP
Save to your folder(s)

Prevent direct access to php file (Prevenir acesso direto ao arquivo php)


Copy this code and paste it in your HTML
  1. if (stristr(htmlentities($_SERVER['PHP_SELF']), "config.php"))
  2. {
  3. Header("Location: ../index.php");
  4. die();
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.