Re: FOPEN

From: Date: Sat, 19 Feb 2005 19:37:58 +0000
Subject: Re: FOPEN
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209068@lists.php.net to get a copy of this message
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.

« previous php.general (#209068) next »