Re: it cant authenticates!!!!!!!!!!!!!!!!!!!!!!!!MySQL

From: Date: Tue, 31 Aug 2004 01:43:21 +0000
Subject: Re: it cant authenticates!!!!!!!!!!!!!!!!!!!!!!!!MySQL
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14344@lists.php.net to get a copy of this message
* Pahlevanzadeh Mohsen <m_pahlevanzadeh@yahoo.com>: > Dear My code is :<? > set_include_path(get_include_path().'/'.'auth'); This should be: set_include_path(get_include_path() . ':' . 'auth'); The '/' that you used is adding /auth to the end of a path already being looked in -- and will likely mean that other libraries won't be found. A ':' in path statements *separates* paths for the path parser -- effectively letting you specify *multiple* paths to look in. Better yet... grab the Auth modules using pear, instead of downloading them and putting them in non-standard directories. > include_once('Auth/Auth.php'); > > function x(){echo "xxxxxxxxxxxxxxxxxxx";} > > $parameterforauth=array("dsn"=>"mysql://mohsen:loverx@localhost/mem", > "table"=>"usernames", > "usernamecol"=>"user", > "passwordcol"=>"pass"); > $ptr_auth_C=new auth("DB",$parameterforauth,"x"); > $ptr_auth_C->start(); > if ($ptr_auth_C->getAuth()) > echo "okkkkkkkkkkkkkkk"; > ?> > I have a bank what named mem & i have table for mem > that it named usernames.Also it has user & pass > fields. > I inserted mohsen as user & loverx as passwd. > my source code must print okkkkkkkkkkkkk on the > browser. > But i don't see it. > It just print xxxxxxxxxxxxxxxx. Is the password stored in the database as an MD5 of loverx? My guess is that it isn't -- that you either stored it as plaintext or using MySQL's password() or SHA() functions. To make sure... execute the following in a MySQL client: UPDATE usernames SET pass = MD5('loverx') WHERE user = 'mohsen'; Then try running your script again. -- Matthew Weier O'Phinney | mailto:matthew@garden.org Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org

« previous php.pear.general (#14344) next »