Location: PHPKode > scripts > M-Ariza Maintenance Follow-up Web Application > m-ariza-maintenance-follow-up-web-application/mariza/admin/index.php
<?
if (isset($_GET["exit"])){
	session_start();
	session_destroy();
	echo "<script>location.href=\"index.php\";</script>";
	exit;
}
if(isset($_POST['submit']) && !empty($_POST['submit'])){
	if (!isset($_POST["username"]) || empty($_POST["username"])){$hata = "Please Enter Username";}
	if (!isset($_POST["password"]) || empty($_POST["password"])){$hata = "Please Enter Password";}
	include "../inc/conn.php";
	if($sitequ = mysql_query("SELECT * FROM users WHERE user='{$_POST['username']}' AND pass='".md5($_POST['password'])."'")){
		if (mysql_num_rows($sitequ) > 0){
			$data = mysql_fetch_array($sitequ);
			session_start();
			$_SESSION['user']=$data['user'];
			$_SESSION['pass']=$data['pass'];
			echo "<script> location.href='records.php';</script>";
			exit;	
		}else{$hata= "Wrong Password";}
	}
}
if ($hata!=null){
	echo "<html><body><table height=\"100\" width=\"531\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\"><b>::: Error :::</b></td></tr><tr><td align=\"center\">$hata</td></tr>";
	echo "<script> setTimeout(\"location.href='index.php';\", 1500); </script></body></html>";
	exit;
}
include "../inc/head.php";
?>
<body>
    <form action="" method="post">
        <table width="531" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2">
                    <img src="../images/logo.gif" width="215" height="72">
                </td>
            </tr>
            <tr align="center" bgcolor="#CCCCCC">
                <td height="25" colspan="2">
                    <span>Maintenance Follow-up Application</span>
                </td>
            </tr>
            <tr bgcolor="#f7f7f7">
                <td width="168" height="30" align="right">
                    <span><strong>Username : </strong></span>
                </td>
                <td width="363" height="30">
                    &nbsp;<input name="username" type="text" id="username" autocomplete="off">(admin)
                </td>
            </tr>
            <tr>
                <td height="30" align="right">
                    <span><strong>Password : </strong></span>
                </td>
                <td height="30">
                    &nbsp;<input name="password" type="password" id="password" autocomplete="off">(admin)
                </td>
            </tr>
            <tr bgcolor="#f7f7f7">
                <td height="30">
                    &nbsp;
                </td>
                <td height="30">
                    &nbsp;<input type="submit" name="submit" value=" Enter ">&nbsp;
                </td>
            </tr>
            <tr align="right" bgcolor="#AAAAAA">
                <td height="20" colspan="2">
                    <span style="color: #FFFFFF">PHP Version&nbsp; </span>
                </td>
            </tr>
            <tr align="center" bgcolor="#000000">
                <td height="15" colspan="2">
                    <span class="finemini style6">All Rights Reserved - Maskproduction Internet Solitions</span>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
Return current item: M-Ariza Maintenance Follow-up Web Application