Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $headers = getallheaders(); ?>
- <?php if (array_key_exists('X-Requested-With', $headers) AND $headers['X-Requested-With'] === 'XMLHttpRequest'): ?>
- <?php print_r($_SERVER); ?>
- <?php else: ?>
- <html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>jquery.basic.auth</title>
- </head>
- <body>
- <script src="jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript" charset="utf-8">
- jQuery(document).ready(function ($, undefined) {
- $.ajax({
- url: 'index.php',
- username: 'user',
- password: 'pass',
- success: function (data) {
- console.log(data);
- }
- });
- });
- </script>
- </body>
- </html>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement