Reputation: 5757
if ($_SERVER['HTTP_REFERER'] == "????")
What would the HTTP_REFERER
be if this page was reached by a JQuery $.post request?
Upvotes: 2
Views: 3809
Reputation: 3912
try
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
Note That not all servers provide this variable
and you can read this Detecting Ajax in PHP and making sure request was from my own website
Upvotes: 4