Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/repo/
Upload File :
Current File : /var/www/html/venkat/repo/checklogin.php

<?php

$id=$_POST['myusername'];
$pd=$_POST['mypassword'];

ini_set('session.cookie_httponly', 1);


ini_set('session.use_only_cookies', 1);


ini_set('session.cookie_secure', 0);


include("db.php");

include_once("from_ldap.php");

if (chk_pass($id, $pd) == TRUE) {
	$count = 1;
} 
else {
	$count = 0;
}


if($count==1){



	session_start();
	$_SESSION['username'] = $id;
	$stmt = $link->prepare("select dept from faculty where email = ?");
	$stmt->execute(array($id));
	foreach($stmt->fetchAll() as $row) {
       		$dept = $row['dept'];
	}
	if(isset($dept)) { 	
		$_SESSION['dept'] = $dept;
		$_SESSION['LastRequest'] = "hello";
		$_SESSION['expire'] = time();
		header("location:login_success.php");
	}
	else {
		echo "You are not authorized to use this.";
	}
}
else {
	echo "<font color='red'><center> Wrong Username or Password. Try Again. </center> </font><br>";
?>




<center> <h1> <font color="blue"> <i> Elective Submission Portal </i>  </font>  </h1> </center>




<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="checklogin.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>User Login </strong></td>
</tr>
<tr>
<td width="250">Username</td>
<td width="16">:</td>
<td width="394"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr>



<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="50"><div align="right"><input type="submit" name="Submit" value="Login" onmouseover="validateForm()"></div></td>
</tr>
</table>
</td>
</form>
</tr>
</table>



<?php
}
?>