Reply to Re: DIssapearing/reappearing Session variables

Your name:

Reply:


Posted by iktorn on 04/10/07 06:53

dangerd napisał(a):
> On Apr 10, 6:44 am, iktorn <s...@phpfreelancer.net> wrote:
>> dangerd napisał(a):
>>
> Wiktor,
>
> I have tried what you suggested but the problem, still persists. I
> have updated the txt code so you can see for yourself.
> ...any more ideas?
>
> Thanks
>
> Duncs
>

replace auth function with these piece of code, should work

function auth ( $login = '', $password = '' )
{
if (isset($_SESSION['authdata']['login'])) {
return TRUE;
}
elseif (!empty($login))
{
if ( $login == myuser && $password == mypass or $login ==
myuser2 && $password == mypass2 ) {
$_SESSION['authdata'] = array ( "login" => $login );
return TRUE;
}

$_SESSION['authdata'] = array();
return FALSE;
}
else {
return FALSE;
}
}

your previous function used "global $authdata;" - variable $authdata
would only exist if you had register_globals turned on.


--
Wiktor Walc
http://phpfreelancer.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

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