You are here: Re: How to set the username/password when using http authentication? « PHP Language « IT news, forums, messages
Re: How to set the username/password when using http authentication?

Posted by Rik on 03/07/07 22:15

Els <els.aNOSPAM@tiscali.nl> wrote:

> Rik wrote:
>
>> Change:
>>>>>> if($row['passwd']=3D=3D$_SERVER['PHP_PW']) $verified =3D true;
>> To:
>> if($row['passwd']=3D=3Dmd5($_SERVER['PHP_PW'])) $verified =3D true;
>
> Still won't work.
> It's most likely something I'm doing wrong, like where in the script I=

> place the lot, but I can't figure out what it is.
> Thanks for your help anyway, I'll keep the code so I may use it if I
> need to do the same thing some time outside Joomla.

If it doesn't work:

1. Enable error_reporting if it isn't on already =

(ini_set('display_errors',true);error_reporting(E_ALL);

2. var_dump() the variables you are using in strategic places, to check =
=

wether they contain what you think they should. For instance, right befo=
re =

the above line you could use =

var_dump($row['passwd'],$_SERVER['PHP_PW'],md5($_SERVER['PHP_PW']));

Keep in mind that for headers to work, they have to be sent before any =

other output. Seems to go OK if you get a prompt for a username & passwo=
rd =

though.

On a side note: you do know I made the table- and fieldnames up, as I ha=
ve =

no idea how they're called in Joomla?
-- =

Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel

 

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

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