Hi,
I have a website that’s main index page requires HTTP basic authentication which is currently done through apache. (This I cannot change)
What I am trying to do is create a PHP page that will relocate to this page using the code below and that will automatically log me on using the username and password already in the script.
<?php
$user = “bob”;
$passwd = “3he4kwf”;
header( “Location: https://here.there.com”);
?>
This redirects me to https://here.there.com however I am then prompted for my username and password.
One possible solution I have tried was:
<?php
$user = “bob”;
$passwd = “3he4kwf”;
header( “Location: https://$user:$passed@here.there.com”);
?>
However this still prompts for a login, thus doesn’t work.
Another tried solution is:
<?php
$user = “bob”;
$passwd = “3he4kwf”;
header( “Location: https://here.there.com”);
header(“Authorization: Basic “.base64_encode(“$user:$passwd”))
?>
This also does not work! 🙁
Does anyone have another solution that might work me?
Any extra information will be most welcome!
Neil