.htaccess - Is there any danger in allowing direct access to PHP files? -
i have bunch of helper files , parsers, of called through ajax. understanding can't use .htaccess block access files break ajax. question is: there harm or danger in allowing direct access files? if so, how allow ajax block users accessing them?
you can use php $_server
value validate ajax requests if user use spoofing
not work if have perfect validations in php scripts don't worry direct access
if(isset( $_server['http_x_requested_with'] ) && ( $_server['http_x_requested_with'] == 'xmlhttprequest' ) ) { //your response } else { //i hate users redirect }
Comments
Post a Comment