I'm loading content of about.php page with jQuery AJAX to my index.php section like this:
$('.nav a[href="#about"]').on('click', function() {
$('main').load('../../layout/about.php');
});
However in my about.php page I have this:
<?php
if( !defined('cute') ) {
die();
}
?>
And index.php page this:
<?php
define('cute', TRUE);
?>
And while heading from index to about page, nothing loads. When I commenting out "php files' direct access block" code - about.php loads, however then I can access included PHP files directly.
Could you please help me to achieve direct access of included PHP files blocking and loading them by AJAX at the same time? Thank you!