Psyduck - 可達鴨 之 鴨力山大 v0.1
Current File : /home/irplbiz/www/lnselgallery/control/index.php |
<?php
session_start();
include('includes/db_connect.php');
if(isset($_REQUEST['Submit']))
{
// username and password sent from form
$myusername=$_REQUEST['uname'];
$mypassword=$_REQUEST['pass'];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = md5(mysql_real_escape_string($mypassword));
$sql="SELECT * FROM ln_tbl_admin WHERE user='$myusername' and pass='$mypassword'";
// Mysql_num_row is counting table row
$result=mysql_query($sql);
$count=mysql_num_rows($result);
$resultSet=mysql_fetch_array($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count>0){
// Register $myusername, $mypassword and redirect to file "login_success.php"
$_SESSION['loggedin']=1;
$_SESSION['role']=$resultSet['role'];
$_SESSION['id']=$resultSet['id'];
echo "<script>window.location.href='pass_change.php'</script>";
}
else {
$msg = "Wrong Username or Password";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to Tender Master</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="css/form-style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style4 {color: #FFFFFF;}
.style4 a {color: #FFFFFF;
text-decoration:none;}
.style1 { color: #ed8c21;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="10" cellpadding="10" style="padding:10px;">
<tr>
<td height="29" align="center" valign="top" style="font-size:30px; color:#24456a; font-weight:bold;"><strong>Lnsel Portfolio Gallery</strong></td>
</tr>
<tr>
<td height="30" align="center" style="font-size:18px; color:#1c6dc8; font-weight:bold;">Administrator Control Pannel </td>
</tr>
</table>
<table width="100%">
<tr>
<td style="padding:10px;">
<table align="center" style="background:#FFFFFF; border:1px solid #ccc; padding:10px; border-radius:10px; margin-top:20px;">
<tr>
<td>
<?php
$msg = "";
echo $msg;
?>
<form action="" method="post" name="form1">
<table width="603" border="0" cellspacing="0" cellpadding="0" align="left" style="padding:20px; background:#FFFFFF; border:4px solid #1c6dc8;">
<tr>
<td colspan="3" align="center" style="background-color:#25374b; padding:10px 0; color:#fff;"><strong>Welcome to Admin Panel</strong></td>
</tr>
<tr>
<td width="126"><div align="right"></div></td>
<td width="32"> </td>
<td width="245"> </td>
</tr>
<tr>
<td><div align="right"><strong>Username</strong></div></td>
<td align="center"><strong>:</strong></td>
<td><input type="text" name="uname" /></td>
</tr>
<tr>
<td width="126"><div align="left"></div></td>
<td width="32" align="center"> </td>
<td> </td>
</tr>
<tr>
<td><div align="right"><strong>Password</strong></div></td>
<td align="center"><strong>:</strong></td>
<td><input type="password" name="pass" /></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</table>
</form></td>
</tr></table>
</td>
</tr>
</table>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td class="text" style="text-align:center;">Site Design and Developed by <span class="lnsel style4"><a href="http://www.lnsel.com" style="color:#213954;"><strong>LNSEL</strong></a></span></td>
</tr>
</table>
</body>
</html>