Location: PHPKode > projects > Decider > decider/Login/login.php
<?php
session_register('authuser');
session_destroy();

?>
<html>
<head><link rel="stylesheet" type="text/css" href="../common/styles.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Login</title>
<link rel="stylesheet" type="text/css" href="../common/styles1.css"/> 
<!-- help code-->
<script language="javascript">
var id;
var txtname;
function handleSearchSuggest(txt) {
var str;

			id=txt;
			txtname=txt;		
			var ss = document.getElementById("help");
			ss.innerHTML = '';
			if(id=="loginhelp"){
		    str = "Enter your user name and password to log on to the system.";
			}
			
			var suggest = '<div onmouseover="javascript:helpOver(this);" ';
			suggest += 'onmouseout="javascript:helpOut(this);" ';
			suggest += 'onclick="javascript:closeBox(this.innerHTML);" ';
			suggest += 'class="suggest_link">'+ str + '</div>';
			ss.innerHTML += suggest;
			}

//Mouse over function
function helpOver(div_value) {
	div_value.className = 'help_over';
}
//Mouse out function
function helpOut(div_value) {
	div_value.className = 'help_out';
}
//Click function
function closeBox(value) {
	document.getElementById("help").innerHTML = '';
}

</script>
</head>


<body>



<div align="center">

<form method="post" name="loginform" action="../Login/intermediate.php">

<table width="800px"><tr><td align="left" valign="top"><?php require('../common/top.html'); ?></td>
	</tr></table>
<table border="0" width="277">

<tr><td align="center" height="40" width="93"></td> </tr>

<tr>
	<td height="56" class="label">User name</td> 
	<td width="174"><input  type="text" name="user" class="textbox1"><br/></td>
</tr>
<tr>
	<td class="label">Password </td>
	<td><input type="password" name="password" class="textbox1"><br/></td>
</tr>

<tr><td align="center" height="28" width="93"></td> 
</tr>

<tr>
	<td></td>
	<td> 
	
	<input type='submit' value='Log on' class="button">

	</td><td><img src="../common/HelpIcon.gif" height="30" width="30" type="" name="Submit"  id="loginhelp" onClick="handleSearchSuggest(this.id)" class="pointer"><div id="help" class="length" > </div>
</td>
</tr>
</table>
</form> 

<?php 
	
	$conn = mysql_connect("localhost","root","");
	if (!$conn ){
		echo("Couldn't connect ".mysql_error());
	}

	//Create Account........................................
	mysql_select_db(my_db,$conn);
	
	if($_POST[createUserName]!="" && $_POST[createPassWord]!=""){
		$sql1="insert into Analist(User_Name,Pass_Word) values('$_POST[createUserName]','$_POST[createPassWord]')";
		if(!mysql_query($sql1,$conn))
			echo("ERROR : ".mysql_error());
		else
			echo("ADDED");	
	}
	//LOGIN TO WEB SITE..................................
	mysql_select_db(my_db,$conn);
	if($_POST[userName]!="" && $_POST[passWord]!=""){
		$result = mysql_query("SELECT * FROM Analist");
		while($row = mysql_fetch_array($result)){
			if($row['User_Name']==$_POST[userName] && $row['Pass_Word']==$_POST[passWord]){
 			 	echo ("<a href='../client/addclient.php'>LINK</a>");
				break;
			}
		}
		if(($row['User_Name']!=$_POST[userName] || $row['Pass_Word']!=$_POST[passWord])){
				echo("ERROR : YOUR USER NAME OR PASSWORD IS INCORRECT.");
				}
			
	}
	mysql_close($conn);
?>

</div>

</body>
</html>
Return current item: Decider