免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1588 | 回复: 2
打印 上一主题 下一主题

我写的php代码(管理员的操作)遇到了瓶颈,求教,下面那几个submit怎么写啊??? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-11-20 18:55 |只看该作者 |倒序浏览
<?
session_start();
if (!isset($_SESSION['user'])) {
            $_SESSION['user']="";
        exit;
}
?>

<?
$name=$_POST['name'];
$db = mysql_connect("localhost","root","642531") ;
mysql_select_db("news",$db);
$query="select name,password from info where status='0'";
$result=mysql_query($query) or die("稍后再试");
?>

<?php
if($user==""){
?>
<a href="register.php" target="_blank"><font color=#0000ff>注册帐号</font></a>
&nbsp;
<a href="load_1.php" target="_blank"><font color=#0000ff>用户登录</font></a>
<?
}else{

?>
<a href="quit.php" target="_self"><font color=#0000ff>退出</font></a>
&nbsp;
<a href="zone.php" target="_self"><font color=#0000ff>个人中心</font></a>
<?
}
if($user==""){
echo "<center>";
echo "<h2><font color=red>对不起!您还未登录!</font></h2>";

}else{
?>
<table width="755" border=1 cellSpacing=0 cellPadding=1 align=center>
<tr align=center  bgcolor=55aadd>
        <th width="168"><FONT style="FONT-SIZE: 14px">用户名</th>
        <th width="175"><FONT style="FONT-SIZE: 14px">密码</th>
        <th width="175"><FONT style="FONT-SIZE: 14px">管理</th>
</tr>

<tr>

<?

        while($myresult=mysql_fetch_array($result)){
?>
<tr align=middle bgcolor=77ccff>
    <td width="168" align=center bgcolor=55aadd>
<?
                echo $myresult[name];
?>
        <td width="175" bgcolor=77ccff align=center>
<?
echo $myresult[password];
?>
     </td>
        <td width="175" bgcolor=77ccff align=center>

        <input type=submit name="submit1" value="删除" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">

                <input type=submit name="submit2" value="修改" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">

                <input type=submit name="submit3" value="封锁" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
                <input type=submit name="submit4" value="解封" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
     </td>

</tr>
<?       
        }
?>

</table>
<?
}
?>

论坛徽章:
4
水瓶座
日期:2013-09-06 12:27:30摩羯座
日期:2013-09-28 14:07:46处女座
日期:2013-10-24 14:25:01酉鸡
日期:2014-04-07 11:54:15
2 [报告]
发表于 2012-11-26 22:45 |只看该作者
啥叫瓶颈... 原理理解了写php不就是码农吗

论坛徽章:
0
3 [报告]
发表于 2012-11-30 11:55 |只看该作者
先学学smarty吧。这个太乱。看不下去。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP