Redirection on direct access to PHP script -


i'm building website contains considerable amount of object-oriented php code. keep code clean, each class stored in single file named [classname].class.php , require_once'd in script file. being form evaluation script, has redirections based on post variable prevent dummy execution , database errors.

how make trying access .class.php files gets redirected related html page, keep usable include , require?

you can either

  • put outside public_html folder
  • deny access/redirect using filename patterns in .htaccess
  • build small php code in (the top of every class file) looks variable initialised in index. if it's not there, redirect.

if need further explanation on of these, ask.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -