Psyduck - 可達鴨 之 鴨力山大 v0.1

Current Path : home/irplbiz/public_html/lnselgallery/
Upload File :
Current File : /home/irplbiz/public_html/lnselgallery/index.php

<?php 

	ob_start();

	session_start();

	include ("control/includes/db_connect.php"); 

	

	if( isset($_REQUEST['txtlogin']) && $_REQUEST['txtlogin'] == 'LoginValue' )

	{

		$username = $_REQUEST['username'];

		$password  = $_REQUEST['password'];

		

		if(!empty($username))

		{

			$sql = "SELECT * FROM `user` WHERE username = '".$username."' AND password = '".$password."' AND `role` = 'PRODUCT' AND `active` = 1";

			$rs = mysql_query($sql);

			$rsSet = mysql_fetch_array($rs);

			

			if((mysql_num_rows($rs)>0) && (strcmp($username,$rsSet['username']) == '0') && (strcmp($password,$rsSet['password']) == '0'))

			{

			

			  

				//session_register("username");

				$_SESSION['username'] = $username;

				header("location: categories.php");

			}

			else

			{

				header("location: index.php?login=failed");

			}

		}

	}

?>	



<!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=utf-8" />

<title>LEE &amp; NEE Softwares Exports Ltd</title>

<link rel="stylesheet" href="style.css" type="text/css" />

<link rel="icon" href="images/favicon.ico" type="image/x-icon"/> 

<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"/>



</head>



<body style="background-position:left -250px;">

<div class="container">

	<div class="wrapper">

    	<div class="header">

        	<div class="logo-center"><a href="index.php"><img src="images/logo.png" alt="LEE &amp; NEE Softwares Exports Ltd" title="LEE &amp; NEE Softwares Exports Ltd" width="350" /></a></div>

        </div>

        <div class="loginpanel">

		 <?php

							if(isset($_REQUEST['login']) && $_REQUEST['login'] == 'failed')

							{

								?>

								<font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif" size="+1"><b>Invalid Username or Password.</b></font>

								<?php

							}

							if(isset($_REQUEST['login']) && $_REQUEST['login'] == 'expired')

							{

								?>

								<font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif" size="+1"><b>Login Expired.</b></font>

								<?php

							}

							if(isset($_REQUEST['login']) && $_REQUEST['login'] == 'not')

							{

								?>

								<font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif" size="+1"><b>Login Please.</b></font>

								<?php

							}

							if(isset($_REQUEST['login']) && $_REQUEST['login'] == 'logout')

							{

								?>

								<font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif" size="+1"><b>Successfully Logged-Out.</b></font>

								<?php

							}

							?>

        <form id="login" name="login" action="index.php" method="post">

        <input type="hidden" id="txtlogin" name="txtlogin" value="LoginValue" />

            <div class="inputwrapper">

                <input type="text" name="username" id="username" placeholder="Enter Username" />

            </div>

            <div class="inputwrapper">

                <input type="password" name="password" id="password" placeholder="Enter Password" />

            </div>

            <div class="inputwrapper">

                <button name="submit">Sign In</button>

            </div>          

        </form>

        </div>

	</div>

    

</div>

</body>

</html>