Stumped
Posted: Wed Oct 29, 2003 9:39 pm
What I am trying to do is create a PHP/MYSQL based login and register system. So far, I have managed to make it so you can register, which will create a table with a name the user specifies in my database. I can login fine after I create it, it's just my problem is for dealing with people who entered in a login name that doesn't exist. Please tell me what i am doing wrong, or at least some type of clue
Login.php
And yes, it does work if you enter in a viable loginname, just if you don't it gives error messages..
Login.php
Code: Select all
<?php
$link = mysql_pconnect("localhost:3306","The master", "")
or die ;
mysql_select_db(RPG);
$loginname = $_POSTї'loginname'];
$password = $_POSTї'password'];
$blank = "";
$result = mysql_query("SELECT password FROM $loginname WHERE (loginname = '$loginname')");
while ($row = mysql_fetch_array($result)) {
$passcheck = ("$rowї0]");
}
if ($password <> $passcheck) {
echo "Did you type the wrong password in? Click" ?> <a href="http://localhost/login.html">here</a> to go back.
<?php
}
elseif ($passcheck == $blank) {
echo "That login name does not exist. Click" ?> <a href="http://localhost/login.html">here</a>to go back.
<?php } ?>