Hey everyone,
Ive basically got login.php with two boxes (id/password) and auth.php
//Logging int DB
<?php
$connect = mysql_connect("-------", "------", "--------") or die(mysql_error());
// Selects DB
mysql_select_db("sky1_system") or die(mysql_error());
// Auth's ID/Password
$sql="SELECT id FROM Kiev_Pilots WHERE id='".$_POST['id']."' AND password='" .$_POST['password']. "'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
$S="SELECT firstname,lastname FROM Kiev_Pilots WHERE id='" .$_POST['id']. "'";
while ($row = mysql_fetch_row($result, MYSQL_BOTH)) {
}}
// If correct --
else{
print "successfully logged into system '" .$_row['firstname']. "' '" .$_row['lastname']. '" ";
}?>
What id like it to is, to check the database for id/password if isnt correct, state "no such login" etc, and if it is correct display Sucessfully logged into the system [There First Name / Last Name] (firstname,lastname in db).
I have been getting no where with this - tried googling and no help.
Cheers!