Thursday, 31 July 2014

Login_code & login_desgin

//login_code
<?php
$con=mysql_connect('localhost','root'.'') or die('not');
$db=mysql_select_db('mitul')or die('not db');

if(isset($_POST['btnlogin']))
{
    $uname=$_POST['txtuname'];
    $upass=$_POST['txtupass'];
   
    $sql="select * from login where uname='$uname' and upass='$upass'";
    $res=mysql_query($sql) or die('not excut');
      if($res)
      {
       echo "redirect";
      }
}

?>

===============


 login_desgin


<!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>Untitled Document</title>
</head>

<body>

<form id="form1" name="form1" method="post" action="login_code.php">
  <table width="414" border="1">
    <tr>
      <td colspan="2"><div align="center">Admin Login</div></td>
    </tr>
    <tr>
      <td width="177" >User Name</td>
      <td width="221"><label>
        <input type="text" name="txtuname" id="txtuname" />
      </label></td>
    </tr>
    <tr>
      <td>User password</td>
      <td><label>
        <input type="text" name="txtupass" id="txtupass" />
      </label></td>
    </tr>
    <tr>
      <td colspan="2"><label>
       
        <div align="center">
          <input type="submit" name="btnlogin" id="btnlogin" value="Login" />
        </div>
      </label></td>
    </tr>
  </table>
  <div align="right"></div>
</form>
</body>
</html>



2 comments:

  1. Read about password security. Newer store users password in plane text!

    ReplyDelete