php当中的SQL语句要怎么写,高手帮忙看看我的代码
把这段代码放在网页下后。点击确定按扭,用户名NAME在数据库中的accounts表内BANNED=0。<?php$name=$_POST['name'];include(...
把这段代码放在网页下后。点击确定按扭,用户名NAME在数据库中的accounts表内 BANNED =0。
<?php
$name = $_POST['name'];
include('functions\config.php');
if($name == ""){
echo '没填用户名.';
exit();
}else{
update accounts set banned=0 where name=$name
echo ' OK';
}
?>
在贴一个index.PHP的代码:
<!--- By SuperFun ---!>
<!--- Version 3 ---!>
<style>
*{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; } b { FONT-WEIGHT: bold; } .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; } td.list { BACKGROUND: #EEEEEE; white-space: nowrap; } body {
background-image: url(default/bg.jpg);
}</style>
</head>
<center><br><br><br><br>
<h1>safe</h1>
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>safe</td></tr>
<form action="register_do1.php" method="POST">
<tr><td class=list align=right>用户名:</td><td class=list><input type=text name=name maxlength="30"></td></tr>
<input type=submit name=submit value='确认'></td></tr>
</form>
</table>
<br> 展开
<?php
$name = $_POST['name'];
include('functions\config.php');
if($name == ""){
echo '没填用户名.';
exit();
}else{
update accounts set banned=0 where name=$name
echo ' OK';
}
?>
在贴一个index.PHP的代码:
<!--- By SuperFun ---!>
<!--- Version 3 ---!>
<style>
*{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; } b { FONT-WEIGHT: bold; } .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; } td.list { BACKGROUND: #EEEEEE; white-space: nowrap; } body {
background-image: url(default/bg.jpg);
}</style>
</head>
<center><br><br><br><br>
<h1>safe</h1>
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>safe</td></tr>
<form action="register_do1.php" method="POST">
<tr><td class=list align=right>用户名:</td><td class=list><input type=text name=name maxlength="30"></td></tr>
<input type=submit name=submit value='确认'></td></tr>
</form>
</table>
<br> 展开
2个回答
展开全部
呵呵 ,看着有点好笑
<?php
$name = $_POST['name'];
include('functions\config.php');
if($name == ""){
echo '没填用户名.';
exit();
}else{
update accounts set banned=0 where name=$name
echo ' OK';
}
?>
"update accounts set banned=0 where name=$name " 这段查查手册用函数来代替了吧
<?php
$name = $_POST['name'];
include('functions\config.php');
if($name == ""){
echo '没填用户名.';
exit();
}else{
update accounts set banned=0 where name=$name
echo ' OK';
}
?>
"update accounts set banned=0 where name=$name " 这段查查手册用函数来代替了吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询