Re: Authenticating User ID/Pass in Database problem

From: Date: Mon, 27 Nov 2000 08:14:55 +0000
Subject: Re: Authenticating User ID/Pass in Database problem
Groups: php.general 
Request: Send a blank email to php-general+get-27318@lists.php.net to get a copy of this message
You have a , after company which simply tells that the query is not executing.... and there are some parse errors too! thanks. --- Erik Boles <erik@rmwt.net> wrote: > I am sure this question has been asked before, but > have searched the digests > and have not found anything. > > We have a form that is asking for User ID (userid) > and Password (password) > and then passing them to login.php3 (code below). > The code _should_ give a > success message and link to those who supply both > pieces correctly and an > error message to those who do not. However, the > code below is giving the > error message regardless of whether the information > being supplied is > correct or not. > > Any help on what we have done wrong is greatly > appreciated. > > ====================== > <HTML><BODY> > > <?php > switch ($position) > { > case "process": > require('logon.inc'); > $query = "select userid, password, company, > from registration where > userid='$userid' and password='$password'"; > $result = mysql_query($query); > $row = @mysql_fetch_array($result > > if ($row["userid"] == $userid) > { > if ($row["password"] == $password) > > > ?> > <html><head></head><body > bgcolor="#FFFFFF"> > <center> > Welcome back to the website, <?PHP > print $row["company"]; > ?>.<br><br> > Please click <a > href="registered/registered.html" > target="_top">here</a> to > complete the login process and begin > using the site. > </center> > <?php > } > else > { > ?> > <html><head></head><body > bgcolor="#FFFFFF"> > <center> > <B> > Either you do not currently have a > membership with us or you > have entered > an invalid Member ID/Password > combination.<br><br> > Please click <a > href="register/register.htm" > target="_top">here</a> to > join<br><br>-OR-<br><br>Click <a > href="index.htm">here</a> > to try again. > </B> > </center> > <?php > } > } > else > { > ?> > <html><head></head><body bgcolor="#FFFFFF"> > <center> > <B> > Either you do not currently have a membership with > us or you have entered > an invalid Member ID/Password combination.<br><br> > Please click <a href="register/register.htm" > target="_top">here</a> to > join<br><br>-OR-<br><br>Click <a > href="index.htm">here</a> to try again. > </B> > </center> > <?php > } > } > ?> > </BODY></HTML> > > ======================================= > > > Erik . > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== To Find Out More About Me : http://mukul.tsx.org/ __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/

« previous php.general (#27318) next »