Hello all
Ive been trying to use headers to log in to a protected folder
Diego kindly gave me this documentation about Authorization but i cant get it to work, it seems straight forward ??
Documentation
To receive authorization, the client sends the userid and password,
separated by a single colon (":") character, within a base64 encoded
string in the credentials.
basic-credentials = "Basic" SP basic-cookie
basic-cookie = <base64 [7] encoding of user-pass,
except not limited to 76 char/line>
user-pass = userid ":" password
userid = *<TEXT excluding ":">
password = *TEXT
Userids might be case sensitive.
If the user agent wishes to send the userid "Aladdin" and password
"open sesame", it would use the following header field:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Header Code
$userandpass = "user:pass";
$encoded= base64encode($userandpass);
header("Authorization: basic $encoded");
header("Location: http://www.protected.com");
Is this the right way to go about it at all ?
Please help, thanks for any advice
Al