$.ajax() username/password - how to capture them
According to jQuery.Ajax, it includes a username and password attribute with the $.ajax call.
- $.ajax({
- url: '<some-file.php>',
- type: 'POST',
- username: <my-username>,
- password: <my-password>,
- data: {code:<some-code>},
- success: function(data){
-
- }
- });
Here I have passed my username and password to <some-file.php>. And in <some-file.php>, I need to capture those username and password.
I tried $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'], but shown Notice: Undefined index: PHP_AUTH_USER and PHP_AUTH_PW
I checked $_REQUEST also, but unable to capture.
Please need your help ?