|
|
|
ทำไมมันฟ้องว่า Parse error: syntax error, unexpected ';' in C:\AppServ\www\coffee\admin\checklogin.php on line 77 |
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<style type="text/css">
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.myform{
margin:0 auto;
width:400px;
padding:14px;
}
/* ----------- stylized ----------- */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:20px;
color:#00FFFF;
font-weight:bold;
margin-bottom:9px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#666666;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:15px;
font-weight:bold;
}
</style>
<title>สำหรับผู้ดูแลระบบ</title>
</head>
<body>
<?
$admin_user = "admin";
$admin_pwd = "2537";
$user_login=(isset($_REQUEST["user_login"]))?$_REQUEST["user_login"];
$_SESSION["sess_userlogin"];
$pwd_login=(isset($_REQUEST["pwd_login"]))?$_REQUEST["pwd_login"];
$_SESSION["sess_pwdlogin"];
if(($user_login!=$admin_user) || ($pwd_login!=$admin_pwd)){
echo "<br><font color=\"red\">Username or password False</font>";
echo "<meta http-equiv='refresh' content-'1;url=index.php'>";
}else{
session_start();
$_session["sess_userlogin"] = $user_login;
echo "<meta http-equiv-'refresh' content='1;url=main.php'>";
}
?>
</body>
</html>
|
|
|
|
|
Date :
2012-12-18 16:57:27 |
By :
tawatchai |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้ายังซับสนกับ if syntax บรรทัดเดียวก็ใช้ if แบบปกติก็ได้ครับ
Go to : PHP if()
|
|
|
|
|
Date :
2012-12-18 17:28:58 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|