Forum Moderators: open
I have a page (.php page) that provides me with live data from a database.. However, this page is HTTP/POST AUTHENTICATED (basic) .. So, normally, if I would enter the name of this PHP file directly into the browser's address field, I would get a USERNAME/PASSWORD dialog box, and only after I enter the correct values, I get the data I want..
I would really really like to have a javascript AJAX request method that implements this username/password authenticaton in a SAFE way, so I don't need to enter the USERNAME/PASSWORD but it instantly returns the parsed value sent by the .php page.
Is this possible? How can I possibly do it?
THANKS! Any help is really appreciated!
Kind regards,
Roel
I would recommend making a PHP proxy page that sends the authentication details. Basically you can have the PHP script call the protected URL with this format:
http://username:password@example.com/path/to/script.php
In the PHP script you could either use cURL or just file_get_contents() depending on how your server is configured.
HTH :)