.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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -