Only allow AJAX for a HTTP Request


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // If the request did not come from AJAX, exit:
  2. if($_SERVER['HTTP_X_REQUESTED_WITH'] !='XMLHttpRequest'){
  3. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.