Location: PHPKode > projects > The Easy Dictionary Maker > login.php
<?php

/*====================================================================================================
======================================================================================================
The Dictionary Maker (TDM) is released under the GNU General Public License (GPL), which is an 
	open-source license that means anyone is free to use, modify, and 
	redistribute it, with a few restrictions. That means that the following 
	text should be included as a comment at the top of every source file:

	========================================================================
	Copyright Daniel Herman 2002

	This file is part of TDM.

	TDM 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.
	
	TDM is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Beehive; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
	USA
	========================================================================
============================================================================================*/

$pword = md5($pword);
include("./config.php");

//----------------------------------------------------------------------------------------------------------------------------------------------------------------

if (!$uname){
 $uname = $HTTP_COOKIE_VARS["npcff_login_uname".$ses_uname];
 $pword = $HTTP_COOKIE_VARS["npcff_login_pword".$ses_pword];
$pword = md5($pword);
}
else {

$error = "<font color=red>Could not verify password / username</font>";
$ses_uname = $uname ;
$ses_pword = md5($pword);
setcookie ("npcff_login_uname", $ses_uname,time()+(3600*168));
setcookie ("npcff_login_pword", $ses_pword,time()+(3600*168));
}

$query = "SELECT * FROM $table_name_memb where uname = '$uname' 
and pword = '$pword' ";
$result = mysql_query($query, $db) or die(mysql_error());
$numRows = mysql_num_rows($result);
for ($count = 0; $count < $numRows; $count++) {
  $resultArray = mysql_fetch_array($result);

$cuname = $resultArray["uname"];
$cpword = $resultArray["pword"];
$cuid = $resultArray["uid"];
}

if (!$cuname){

include("header2.php");
echo "<div align=\"top\">
<img src=\"./members.jpg\">
</div>";
echo "
<form method=POST action=\"$PHP_SELF\">
       <table align=\"left\">
  <tr>
    <td><font face=$style_font_face color=$colour_font>Username:</td>
    <td><input name=\"uname\" type=\"text\" size=\"20\" tabindex=\"1\"></td>
  </tr>
  <tr>
    <td><font face=$style_font_face color=$colour_font>Password:</td>
    <td><input name=\"pword\" type=\"password\" size=\"20\" tabindex=\"2\"></td>
  </tr>
    <tr>
  <td><input type=\"submit\" name=\"submit\" value=\"Log In\" tabindex=\"4\"></td></tr><tr><td>$error</td></tr>
</table>
</form>
<center><font face=$style_font_face color=$colour_font>Not a member, signup <a href=\"./sign.php\">here</a></center><BR><BR><BR><BR><BR><BR><BR>";


exit;
}
else 
?>
Return current item: The Easy Dictionary Maker