Reply to Re: PHP Error on Password Check (SQL Database)

Your name:

Reply:


Posted by Jerry Stuckle on 06/04/07 10:33

Sheik Ishmael wrote:
> Hi, I'm trying to get password recognition calling data froma table
> called users('user_name' and 'user_password' using the below (bottom
> of page) code.
>
> However, I get the following warning from my browser
>
> "Parse error: parse error, unexpected ';' in /data/members/paid/g/l/
> glastonburytv.eu/htdocs/www/check_password.php3 on line 19
>
> This is the line I have replaced my password with "MY PASSWORD"
>
> Now I'm using the same connectivity activater (see line below) in
> other pages
> mysql_connect("localhost", "glastonburytv_eu", "MYPASSWORD")
>
> Does anyone please have any ideas why I'm getting the error message on
> the ";" (line 19)
>
> (Full Code Below)
> Thank You
> --Sheik Ishmael
>
> <html>
> <head>
> <title>Password Checking Script</title>
> </head>
> <body>
> <?php
> function print_form() {
> ?>
> <form action="check_password.php3" method="POST">
> <h3>Please Login</h3>
> User Name: <input type="text" name="user_name">
> <br>Password: <input type="password" name="password">
> <input type="submit" name="submit" value="Login!">
> </form>
> <?
> }
>
> if(isset($submit)):
> if(!$$db = mysql_connect("localhost", "glastonburytv_eu",
> "MYPASSWORD"));
> print("<h1>Can't Connect to the DB!</h1>\n");
> else:
> mysql_select_db("glastonburytv_eu_1");
> endif;
> $sql = "select * from users where user_name = '$user_name'";
> $result = mysql_query($sql);
> $row_count = mysql_num_rows($result);
> if($row_count == 0):
> ?>
> <h3>Wrong User Name! Try Again</h3>
> <?
> print_form();
> else:
> $row = mysql_fetch_array($result);
> if($password != $row["user_password"]):
> ?>
> <h3>Incorrect Password! Try Again</h3>
> <?
> print_form();
> else:
> ?>
> <h3>Password Accepted!</h3>
> <?
> endif;
> endif;
> else:
> print_form();
> endif;
> ?>
> </body>
> </html>
>

if statements do not have semicolons at the end of the conditional
clause. And btw, else doesn't have a colon, either.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.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

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