Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php $headers = getallheaders(); ?>
  2. <?php if (array_key_exists('X-Requested-With', $headers) AND $headers['X-Requested-With'] === 'XMLHttpRequest'): ?>
  3. <?php print_r($_SERVER); ?>
  4. <?php else: ?>
  5. <html>
  6. <head>
  7.     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  8.     <title>jquery.basic.auth</title>
  9.  
  10. </head>
  11. <body>
  12.     <script src="jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"></script>
  13.     <script type="text/javascript" charset="utf-8">
  14. jQuery(document).ready(function ($, undefined) {
  15.     $.ajax({
  16.         url: 'index.php',
  17.         username: 'user',
  18.         password: 'pass',
  19.         success: function (data) {
  20.             console.log(data);
  21.         }
  22.     });
  23. });
  24.     </script>
  25. </body>
  26. </html>
  27. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement