home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
csi.uticak12.org
/
csi.uticak12.org.tar
/
csi.uticak12.org
/
back
/
index.php
< prev
next >
Wrap
PHP Script
|
2011-10-20
|
2KB
|
72 lines
<?php
session_start();
include 'settings.php';
mysql_connect(HostName,UserName,Password) or die("<html><body>Can not connect to MySql server!<br></body></html>");
mysql_select_db (DBName) or die ("<html><body>Could not select database ".DBName."<br></body></html>");
$uname=$_REQUEST['uname'];
$upass=$_REQUEST['upass'];
session_unregister("admname");
session_unregister("admpass");
$bper=0;
if (isset($uname) and isset($upass))
{$RS=mysql_query("SELECT * FROM `gal_admin` WHERE `Alogin`='$uname' AND `Apassword`='$upass'");
if (mysql_numrows($RS)==0)
{
$msg_text='Incorrect username or password!'; }
else{session_register("admname");
$admname=$uname;
session_register("admpass");
$admpass=$upass;
$_SESSION["admname"]=$uname;
$_SESSION["admpass"]=$upass;
echo '<script>location.href="photos.php"</script>'; }
}
?>
<html>
<head>
<title>UCSI Gallery :: CMS :: Login</title>
</head>
<link href="css/style.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align=center>
<? echo $msg_text; ?>
<form name="snd_form" method="post" action="index.php">
<table border=0 cellspacing=0 cellpadding=2>
<tr>
<td class="border">
<table border=0 cellspacing=1 cellpadding=5 width="100%" class="back">
<tr>
<td colspan=2 class="th">Login</td>
</tr>
<tr>
<td class="even" align=right><b>Username :</b></td>
<td class="even"><input type=text size=30 class="inp" name="uname"></td>
</tr>
<tr>
<td class="odd" align=right><b>Password :</b></td>
<td class="odd"><input type=password size=30 class="inp" name="upass"></td>
</tr>
<tr>
<td colspan=2 align=center class="tf"><input type=submit value="Login" class="btn"></td>
</tr>
</table>
</td>
</tr>
</table>
<p align="center"><a href="/csi_index.htm"><img src="/images/csiLogo.jpg" border="0" alt=""/></a></p>
</form>
</td>
</tr>
</table>
</body>
</html>