I have a question about Tank Auth I was hoping someone could help me with.
I am trying to use file_get_contents() within my PHP application to retrieve the html on a page within my application that is behind the Tank Auth login screen. When I use the function with the URL of the page I am trying to get the html from, such as file_get_contents(http://www.testapplication.com/test) all it does is pull down the login screen html.
I know you can use something like this to add authentication to the file_get_contents() function, but it doesn’t seem to work with Tank Auth:
$username = ‘username’;
$password = ‘password’;
$context = stream_context_create(array(
‘http’ => array(
‘header’ => “Authorization: Basic ” . base64_encode(”$username:$password”)
)
));
$data = file_get_contents($url, false, $context);
Can anyone provide me with some information to help me accomplish this?
Thank you very much in advance,