Location: PHPKode > projects > PHP File Database > fdat/login.php
<?php
/*
###############################################################################
# login.php                                                                   #
###############################################################################
# FDat (File Database) Beta Version                                          #
# Open-Source Project by Jeffrey Gelens (hide@address.com)                  #
# =========================================================================== #
# Copyright (c) 2001 Jeffrey Gelens - All Rights Reserved                     #
#                                                                             #
# This program is free software; you can redistribute it and/or               #
# modify it under the terms of the GNU General Public License                 #
# as published by the Free Software Foundation; either version 2              #
# of the License, or (at your option) any later version.                      #
###############################################################################
*/
mysql_connect ("localhost", "root") or die ("Kan geen verbinding maken met server!");
mysql_select_db ("pd") or die ("Database doesn't exist, check settings.php");

$sql = "SELECT * FROM users WHERE username = '$username'";
$result = mysql_query($sql);
$error = mysql_error();

$password = mysql_result($result, '', "password");

if (isset($error)) {
  echo "User don't exist!<br><br>";
}
if ($username == $password) {
  echo "Logged In!";
  }
else {
  echo "Username and password combination doesn't exist!";
  }
?>
    
Return current item: PHP File Database