Reply to Re: Header and Authentification

Your name:

Reply:


Posted by Jerry Stuckle on 07/13/05 20:04

maxx wrote:
> Hi,
>
> I want use the header authentification (HTTP/PHP module), and i've a
> big problem for to get the varaibles 'PHP_AUTH-*".
>
> This is my source code :
> ---------------------------------------------------------------------------------
> <?php
> function authentificate() {
> header('WWW-Authenticate: Basic realm="My Realm"');
> header('HTTP/1.0 401 Unauthorized');
> echo 'Texte utilisé si le visiteur utilise le bouton
> d\'annulation';
> exit;
> }
>
> include("ffrs_mysql-2.inc.php");
> $sql = new MyDB();
>
> $userauth =
> $sql->getAuthUser($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
>
> if ($userauth == ($_SERVER['PHP_AUTH_USER'])) ##
> Don't work
> (or if ("maxx" == ($_SERVER['PHP_AUTH_USER'])) ##
> Work)
> {
> echo "c bon";
> include("adduserAdminForm.php");
> print_r ($_SERVER);
> }
> else
> {
> authentificate();
> }
> ?>
> ---------------------------------------------------------------------------------
>
>
> The window popup authentification don't open and i am going directly on
> my page. When i replace "$userauth" by "maxx" for example, the window
> popup authentification open with no problem and i can login myself.
>

Way too little information for anyone to help you. For instance - what is
"MyDB"? What is the function call "getAuthUser"? What is the function call
"authentificate"?

None of these are standard PHP calls. If they come from a package you're using,
I suggest you follow up with whomever supports that package. Otherwise, we need
to know a lot more about what's happening.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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