11/05/2018, 11:45

Giúp sửa lỗi file PHP

<?php if($_POST["submitLogin"]){ if($_POST["inputName"] && $_POST["inputPass"]){ $user = $_POST["inputName"]; $pass = $_POST["inputPass"]; $connect_db = mysql_connect("localhost", "root", ""); $select_db = mysql_select_db("cafe", ...

<?php
if($_POST["submitLogin"]){
if($_POST["inputName"] && $_POST["inputPass"]){
$user = $_POST["inputName"];
$pass = $_POST["inputPass"];

$connect_db = mysql_connect("localhost", "root", "");
$select_db = mysql_select_db("cafe", $connect_db);
$set_lang = mysql_query("SET NAMES 'utf8'");

$sql = "SELECT * FROM nhanvien WHERE TenNV = '$user' AND MatKhau = '$pass'";
$query = mysql_query($sql);
$num_row = mysql_num_rows($query);

if($num_row > 0){
$_SESSION["inputName"] = $user;
$_SESSION["inputPass"] = $pass;
header("location:nhanvien.php");
}
else{
echo "<script>alert('Tài khoản không hợp lệ!')</script>";
}
}
}
?>

<form role="form" method="post">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" name="inputName" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" name="inputPass" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
<button type="submit" name="submitLogin" class="btn btn-default">Submit</button>
</form>
....
đoạn code của em vậy không biết lỗi chỗ nào mà biến $_POST ko nhận ạ??? mn giúp em với
0