4
I have a file .php
which loads and displays all news from my database, I use this file to load the news dynamically with AJAX. So far so good, the user can go normally on the page index.html
and see the news that was uploaded via AJAX and PHP, but the user can also go to the page noticias.php
and see all the news on the page. But I didn’t want this, there’s no way PHP can return data to AJAX or something? So that the user cannot directly access the noticias.php
?
Got it, didn’t know this feature, thanks!
– André
Q&A of interest: Does $_SERVER['HTTP_X_REQUESTED_WITH'] exist in PHP or not?
– brasofilo