Would it be ok to use the same code to check if customer is loged in? $query = mysql_query(" SELECT COUNT(Username) as NoOfRecords FROM customers WHERE Username = '$Username' AND Password = '$Password'"); if (mysql_result($query, 0) == 0) { echo 'Please try again'; } else { header('location: index.php); exit; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php