Al wrote:
Diana Castillo wrote:
How can I read the contents of a web page that uses basic
authentication? I want to use fopen() but dont know how to do this and
also send the username and password
If the webpage is your script and it is going to check the
authentication stuff, then simply use GET arguments
fopen("http://www.example.com/path/file?user=username&pw=password", 'rb')
Then use....
$user= $_GET['user'];
$pw= $_GET['pw'];
Check the $user and $pw for validity.
If the webpage is not yours, then see if it can accept GET arguments for
authentication, look at your browser's address bar to gain accesss. That
will be your complete URL.
The syntax for basic auth is actually:
http://user:password@xxxxxxxxxxxxxxx
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php