Advertisement
Guest User

PHP

a guest
Feb 8th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2. function doing_ajax(){
  3.     return isset($_SERVER['HTTP_X_REQUESTED_WITH'])
  4.         && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
  5. }
  6.  
  7. if ( doing_ajax() ){
  8.     // I shall do some logic over here, if the logic is true,
  9.     // then I'll tell the client that the request is success.
  10.     echo '{status:true}';
  11.     exit();
  12. }
  13.  
  14. header( 'location: admin.php?loading=dismiss?callback=admin.php?upload' );
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement