📄 newsadmin.php
字号:
<?php
include("pwdsuper.php");
include("connect.inc.php");
include("char.inc.php");
if (isset($flag)){
switch ($op){
case "add":
$pubquery=@mysql_query("select name from zmis41197 where studentnumber=".$userid,$conn)or die(mysql_error());
$pubarray=mysql_fetch_array($pubquery);
$publisher=$pubarray["name"];
$query="INSERT INTO `news` ( `newsfrom`, `title`, `memo`, `author`, `date`, `publisher`, `userid`) VALUES ('$from','$title','$memo','$author',CURDATE(),'$publisher',$userid)";
if(mysql_query($query))
echo "<center></center>";
else
echo "<center>".mysql_error()."</center><br>";
break;
case "delete":
$query="DELETE FROM news WHERE id=".$id." LIMIT 1";
if(mysql_query($query))
echo "<center></center>";
else
echo "<center>".mysql_error()."</center><br>";
break;
case "modify":
$modiquery=@mysql_query("select * from news where id=".$id,$conn)or die(mysql_error());
$modiarray=mysql_fetch_array($modiquery);
//#######################
?>
<html>
<head>
<script language="javascript">
<!--
function ok_onclick(){
var text=""
if(form2.from.value!="" && form2.title.value!="" && form2.memo.value!="" && form2.author.value!="") form2.submit()
else text="你没有填写"
if (form2.from.value=="") text=text+" 来源"
if (form2.title.value=="") text=text+" 标题"
if (form2.memo.value=="") text=text+" 内容"
if (form2.author.value=="") text=text+" 作者"
if(form2.from.value=="" || form2.title.value=="" || form2.memo.value=="" || form2.author.value=="") alert(text)
}
//-->
</script>
<style type="text/css">
<!--
td{font-size:12px;line-height:17px;}
a:active {text-decoration: none;}
a:link {text-decoration: none;}
a:hover{text-decoration: underline;}
a:visited {text-decoration: none;}
BODY{font-size:12px;line-height:17px;SCROLLBAR-FACE-COLOR: #83d160; SCROLLBAR-HIGHLIGHT-COLOR: #CCFF00; SCROLLBAR-SHADOW-COLOR: #CCFF00; SCROLLBAR-3DLIGHT-COLOR: #009900; SCROLLBAR-ARROW-COLOR: #006600; SCROLLBAR-TRACK-COLOR: ##99FF00; SCROLLBAR-DARKSHADOW-COLOR: #009900; }
-->
</style>
<title>::::修改新闻::::</title>
<meta http-equiv="Content-Type" content="text/html;">
<!-- Fireworks 4.0 Dreamweaver 4.0 target. Created Wed Mar 20 14:48:27 GMT+0800 (?D1ú±ê×?ê±??) 2002-->
</head>
<body bgcolor="#dcf6ce" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#666600" link="#009900" alink="#00FF00" vlink="#006600">
<table border="0" cellpadding="0" cellspacing="0" width="621">
<!-- fwtable fwsrc="无标题" fwbase="right.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="15" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="2" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="38" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="55" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="82" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="96" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="87" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="115" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="65" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="30" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="15" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="6" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td colspan="15" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="621" height="5" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0"></td>
</tr>
<tr>
<td colspan="4" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="27" height="19" border="0"></td>
<td colspan="3"><img name="right_r2_c5" src="images/right_r2_c5.gif" width="175" height="19" border="0"></td>
<td colspan="8" bgcolor="#dcf6ce"><div align="right">::::修改新闻:::: </div></td>
<td><img src="images/spacer.gif" width="1" height="19" border="0"></td>
</tr>
<tr>
<td rowspan="9" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="5" height="425" border="0"></td>
<td colspan="3"><img name="right_r3_c2" src="images/right_r3_c2.gif" width="22" height="16" border="0"></td>
<td colspan="2" bgcolor="#83d160"><img src="images/spacer.gif" width="93" height="16" border="0"></td>
<td><img name="right_r3_c7" src="images/right_r3_c7.gif" width="82" height="16" border="0"></td>
<td><img name="right_r3_c8" src="images/right_r3_c8.gif" width="96" height="16" border="0"></td>
<td><img name="right_r3_c9" src="images/right_r3_c9.gif" width="87" height="16" border="0"></td>
<td><img name="right_r3_c10" src="images/right_r3_c10.gif" width="115" height="16" border="0"></td>
<td colspan="3"><img name="right_r3_c11" src="images/right_r3_c11.gif" width="100" height="16" border="0"></td>
<td><img name="right_r3_c14" src="images/right_r3_c14.gif" width="15" height="16" border="0"></td>
<td rowspan="9" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="6" height="425" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0"></td>
</tr>
<tr>
<td colspan="3"><img name="right_r4_c2" src="images/right_r4_c2.gif" width="22" height="60" border="0"></td>
<td><img name="right_r4_c5" src="images/right_r4_c5.gif" width="38" height="60" border="0"></td>
<td colspan="6" bgcolor="#dcf6ce"><img src="images/ad.gif" width="500" height="60" border="0"></td>
<td colspan="2"><img name="right_r4_c12" src="images/right_r4_c12.gif" width="35" height="60" border="0"></td>
<td><img name="right_r4_c14" src="images/right_r4_c14.gif" width="15" height="60" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="60" border="0"></td>
</tr>
<tr>
<td colspan="3"><img name="right_r5_c2" src="images/right_r5_c2.gif" width="22" height="19" border="0"></td>
<td colspan="3"><img name="right_r5_c5" src="images/right_r5_c5.gif" width="175" height="19" border="0"></td>
<td><img name="right_r5_c8" src="images/right_r5_c8.gif" width="96" height="19" border="0"></td>
<td><img name="right_r5_c9" src="images/right_r5_c9.gif" width="87" height="19" border="0"></td>
<td><img name="right_r5_c10" src="images/right_r5_c10.gif" width="115" height="19" border="0"></td>
<td colspan="3"><img name="right_r5_c11" src="images/right_r5_c11.gif" width="100" height="19" border="0"></td>
<td><img name="right_r5_c14" src="images/right_r5_c14.gif" width="15" height="19" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="19" border="0"></td>
</tr>
<tr>
<td rowspan="6" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="15" height="330" border="0"></td>
<td rowspan="2" background="images/box2.gif"><img name="right_r6_c3" src="images/right_r6_c3.gif" width="5" height="302" border="0"></td>
<td rowspan="2" colspan="9" bgcolor="#dcf6ce" valign="top" align="center">
<p> </p>
<p>::::修改新闻::::</p>
<table width="441" border="0" cellspacing="0" cellpadding="0" height="236">
<tr>
<td width="4" height="4"><img src="images/box_top_left.gif" width="4" height="4"></td>
<td background="images/box_bg_top.gif" height="4"><img src="images/box_top.gif" width="136" height="4"></td>
<td width="4" height="4"><img src="images/box_top_right.gif" width="4" height="4"></td>
</tr>
<tr>
<td background="images/box_bg_left.gif" width="4"><img src="images/box_left.gif" width="4" height="170"></td>
<td background="images/box_bg.gif" align="center">
<form name="form2" method="post" action="newsadmin.php">
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td align="right"><font color="#FFFFFF">标题:</font></td>
<td colspan="4" align="left">
<input type="text" name="title" size="30" maxlength="20" value="<?php echo $modiarray["title"];?>">
</td>
</tr>
<tr>
<td valign="top" align="right"><font color="#FFFFFF">内容:</font></td>
<td colspan="4" valign="top" align="left">
<textarea name="memo" cols="28" rows="6"><?php echo $modiarray["memo"];?></textarea>
</td>
</tr>
<tr>
<td align="right"><font color="#FFFFFF">作者:</font></td>
<td colspan="4" align="left">
<input type="text" name="author" size="8" maxlength="8" value="<?php echo $modiarray["author"];?>">
<font color="#FFFFFF">来源:</font>
<input type="text" name="from" size="13" maxlength="20" value="<?php echo $modiarray["newsfrom"];?>">
</td>
</tr>
<tr align="center">
<td colspan="5">
<input type="submit" name="Submit" value="写好了,提交" onClick="ok_onclick();return false">
<input type="reset" name="Submit2" value="写错了,重来">
</td>
</tr>
</table>
<input type=hidden name="userid" value=<?php echo $userid; ?>>
<input type=hidden name="id" value=<?php echo $modiarray["id"];?>>
<input type=hidden name="flag" value="on">
<input type=hidden name="op" value="modi">
</form>
</td>
<td background="images/box_bg_right.gif" width="4"><img src="images/box_right.gif" width="4" height="170"></td>
</tr>
<tr>
<td width="4" height="4"><img src="images/box_bottom_left.gif" width="4" height="4"></td>
<td background="images/box_bg_bottom.gif" height="4"><img src="images/box_bottom.gif" width="136" height="4"></td>
<td width="4" height="4"><img src="images/box_bottom_right.gif" width="4" height="4"></td>
</tr>
</table>
<p> </p></td>
<td background="images/box2.gif"><img name="box2" src="images/box2.gif" width="5" height="1" border="0"></td>
<td rowspan="6" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="15" height="330" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td background="images/box2.gif"><img name="right_r7_c13" src="images/right_r7_c13.gif" width="5" height="301" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="301" border="0"></td>
</tr>
<tr>
<td rowspan="3" colspan="4"><img name="right_r8_c3" src="images/right_r8_c3.gif" width="100" height="21" border="0"></td>
<td colspan="4"><img name="right_r8_c7" src="images/right_r8_c7.gif" width="380" height="3" border="0"></td>
<td rowspan="3" colspan="3"><img name="right_r8_c11" src="images/right_r8_c11.gif" width="100" height="21" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0"></td>
</tr>
<tr>
<td colspan="4" bgcolor="#dcf6ce"><img src="images/copyright.gif" width="380" height="14" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="14" border="0"></td>
</tr>
<tr>
<td colspan="4"><img name="right_r10_c7" src="images/right_r10_c7.gif" width="380" height="4" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0"></td>
</tr>
<tr>
<td colspan="11" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="580" height="7" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="7" border="0"></td>
</tr>
</table>
</body>
</html>
<?php
//######################
exit();
break;
case "modi":
$query="UPDATE news SET title='$title',newsfrom='$from',memo='$memo',author='$author' WHERE id=".$id." LIMIT 1";
if(mysql_query($query))
echo "<center></center>";
else
echo "<center>".mysql_error()."</center><br>";
break;
default:
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -