RE: [PHP-DB] function login problem

From: Date: Thu, 17 May 2001 12:27:37 +0000
Subject: RE: [PHP-DB] function login problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9404@lists.php.net to get a copy of this message
Hi Greg, I can't C a call 2 Ur function login() in the below code-snipplet ... perhaps that's the clue ?? Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - _______________________________________________________________ Suchtreffer AG Bleicherstraße 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:mru@suchtreffer.de internet: http://www.suchtreffer.de _______________________________________________________________ > -----Original Message----- > From: Greg K [mailto:gkelly@kalamazoogazette.com] > Sent: Thursday, May 17, 2001 2:17 PM > To: php-db@lists.php.net > Subject: [PHP-DB] function login problem > > > I am creating a function called login, I have a main file > called index.php > .. which has my login form , it calls a login.php file, and in that > login.php there is file include statement which calls > config.php and that is > where the function lie. This is my function , now if i don't > set this as a > function and just put it my login.php it works fine. But when > I name the > function in put it in my config.php no matter what I do all > ways giving me > the error You have entered an invalid username or password. I > dont know if > this has to do with passing of variables.. or what is going on but if > something can please help me I would appreciate it .. > > Thank You > > function login() { > $query="Select uname from members where pass='$pass'and > uname='$username'"; > $result=mysql_query($query) or die("You are not authorized to > be here."); > $array= @mysql_fetch_array($result); > $uname = $array[0]; > if($uname=="") > { > echo "You have entered an invalid username or password"; > } > else > > { > echo "You are logged in"; > $remote_address = getenv("REMOTE_ADDR"); > echo "Your IP address is $remote_address."; > } > } > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.db (#9404) next »