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
Post a Comment