You are here: Re: [PHP] Re: FOPEN « PHP « IT news, forums, messages
Re: [PHP] Re: FOPEN

Posted by Rasmus Lerdorf on 02/19/05 21:53

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@www.example.com

-Rasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация