I'm building a website that contains a considerable amount of object-oriented PHP code. To keep the code clean, each class is stored in a single file named [classname].class.php
and require_once
'd in the script file. Being a form evaluation script, it already has redirections based on the POST variable to prevent dummy execution and database errors.
How do I make it so anyone trying to access the .class.php
files gets redirected to the related HTML page, but keep it usable by include
and require
?
you can either
If you need further explanation on any of these, just ask.
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.