Hi guys, I separate XHTML from PHP by putting XHTML in a separate file and then using the PHP include()function in a PHP script.
This works fine, but users can still access the file .htmldirectly if they know the address. They can't really handle this much, but I would prefer it not to show.
I saw some scenarios in the past use some form of referrer check, is that what I would do to add some basic (note that I said "basic") restrictions to prevent it from being viewed by directly accessing it?
Thank!
Explanation . I forgot to mention that I want to do this in PHP, so there is no web server configuration (moving files from the root directory, setting the web server to deny access, etc.).). I think that the most logical choice here is to use a constant check define(), which is really what I saw in other scenarios that I forgot, as I stated in my post. I understand that this is probably not the best solution, but given that the html file that may be available does not really matter, the constant define()should be sufficient. Thank you, I appreciate the answers!
source
share