<?php
header("content-type:text/html:charset=utf-8");
include("conn.php");
if(isset($_POST[' ???'])){
$user = $_POST['user'];
$pwd = $_POST['pwd']
$sql = 'user="'.$user? ???? * ?? .'"';
//$sql = "user = '.$user'? ???? * ??";
$result = mysqli_query($conn,$sql) ;
$row = mysqli_fetch_array ($result);
$cmp_pwd = $row['password'];
$quan =$row['quan'];
$xbb = 1;
$fx = 0;
if( $cmp_pwd == $pwd && $quan == $xbb){ //???????? ??? ????? ??? ????? ??
??????????????????????????????? echo "<script ??=javascript>alert('??? ??') ;</script>";
Header("Location:addhc1.php");
//??? ???? ??
}elseif($cmp_pwd1 == $pwd && $quan == $fx ) {H echo "& lt; ???? ?? = javascript & gt; ??('??? ?? ?? ???? ??'); & lt;/script & gt;"
??("??: bddhc1.php"); / /??? ????
}
}
?>
<html>
<head>
<??& gt; ??>
< ; ?? http-equiv="Content-Type" content="text/html" charset="utf-8">
</head>
<body>
<form action="login1.php "method =" post "& gt;
??? ??:
& lt; input type =" text "name =" user " /& gt; " />
" <br/>
? ? ? ? <input type="hidden" name="submitted" value="1" />?
? ? ? ? <input type="submit" value="登錄" />?
? ? ??
? ? </form>?
? ? </body>?
</html>?
?? ?? ?????? ????. ??? ?? ??? ? ????. $sql = 'select * from name where user ='.$user
$sql = 'select * from name where user="'.$user.'"'
?? ???? ?????? ?????.
PHP??? ???? ?? ??? ??? ? ????.
$sql = "select * from name where user='$user';";