www.gusucode.com > 仿51.com的php源码 1.1 > admin/Admin_HomepageBg.php
<?php include("ck_login.php"); include("../include/dbclass.php"); include("../include/page.php"); $dbc=new DbConn(); $maxline = 50; $page=(int)$_GET["page"]; //$deferentparameter="&key=".$key; if($_GET["act"]=="dels") { $id=$_GET["id"]; $sql="delete from homepagebg where id='$id'"; $dbc->Execute($sql); echo "<script>alert('删除完成!');location.href='Admin_HomepageBg.php?page=$page';</script>"; } if($_GET["act"]=="add") { $Mid_Url=$_POST["Mid_Url"]; $Mid_Title=$_POST["Mid_Title"]; $Good=(int)$_POST["Good"]; $Mid_Play=$_POST["Mid_Play"]; $sql="insert into homepagebg (Mid_Url,Mid_Title,Good,Mid_Play) values ('$Mid_Url','$Mid_Title','$Good','$Mid_Play')"; $dbc->Execute($sql); echo "<script>alert('增加成功');location.href='Admin_HomepageBg.php?page=$page';</script>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <link rel="stylesheet" href="admin_style.css"> <style type="text/css"> <!-- .STYLE1 { color: #000000; font-weight: bold; } --> </style> </head> <body> <table cellpadding="2" cellspacing="1" border="0" width="100%" class="border" align=center> <tr align="center"> <td height=25 colspan=2 class="topbg"><span class="STYLE1"> 主页背景音乐管理</span></tr> <tr><td> </td> </tr> </table> <br> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"><tr align=center><td class="tdbg"><form action="?act=add" method="post" name="add"> 试听地址: <input name="Mid_Url" type="text" class="input1" value="/mid/1.wma"/> 播放地址: <input name="Mid_Play" type="text" class="input1" value="%2Fmid%2F1.wma"/> 歌曲标题:<input name="Mid_Title" type="text" class="input1" value=""/> 是否显示红色: <input type="checkbox" value="1" name="Good" /> <input name="Submit" type="submit" class="btn" value="提交" /> </form></td></table> <br> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"> <tr align=center> <td class="topbg" height="28" width="30%"><b>试听地址</b></td> <td class="topbg" height="28" width="30%"><b>播放地址</b></td> <td class="topbg" height="28" width="30%"><b>歌曲标题</b></td> <td class="topbg" height="28" width="10%"><b>删除</b></td> </tr> <?php $sql="select * from homepagebg order by id desc"; $news = $dbc->getGopageRs($sql,$maxline); //echo "$sql"; $gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序 $backurl = "Admin_HomepageBg.php?".$dbc->getParameter(); for($i=0;$i<$dbc->num_rows;$i++) {?> <tr align=center> <td class="tdbg" height=25 width="30%"><?php echo $news[$i]["Mid_Url"]; ?></td> <td class="tdbg" height=25 width="30%"><?php echo $news[$i]["Mid_Play"]; ?></td> <td class="tdbg" height=25 width="30%"><?php if((int)$news[$i]["Good"]>0){?><font color=red><?php echo $news[$i]["Mid_Title"]; ?></font><?php }else{?><?php echo $news[$i]["Mid_Title"]; ?><?php }?></td> <td class="tdbg" height=25 width="10%"><a href="?act=dels&id=<?php echo $news[$i]["id"]; ?>&page=<?php echo $page; ?>">删除</a></td> </tr> <?php }?> </table> <br> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"><tr align=center><td class="tdbg"><?=$gopage->style(2)?></td></table> </body> </html>