home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
csi.uticak12.org
/
csi.uticak12.org.tar
/
csi.uticak12.org
/
back
/
guard.php
< prev
next >
Wrap
PHP Script
|
2011-10-20
|
738b
|
23 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>");
$admname=$_SESSION['admname'];
$admpass=$_SESSION['admpass'];
if (session_is_registered("admpass") and session_is_registered("admname")) {
$RS=mysql_query("SELECT * FROM gal_admin WHERE Alogin='".addslashes($admname)."' and Apassword='".addslashes($admpass)."'");
if (mysql_num_rows($RS)==0){
echo '<script>location.href="index.php"</script>';
exit;
}else{
};
}
else{
echo '<script>location.href="index.php"</script>';
exit;
};
?>