deng0685
高级会员

UID 84760
精华
0
积分 702
帖子 832
金钱 702 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2006-12-13
状态 离线
|
[推荐阅读] PHP程序员
我的网站所有使用了 编辑器 的地方 全都是出这个问题
这是新增新闻的文件的代码
<?php /******************************* Admin_news.php 新增新闻模块 *******************************/
require_once('./include/base.php'); //加载基本配置文件 ?> <style type="text/css"> <!-- body,td,th { font-size: 12px; } --> </style> <SCRIPT language=JavaScript> function CheckForm() { var kong=0; if (document.addNEWS.title.value == "") { alert("新闻标题不能为空!"); document.addNEWS.title.focus(); return false; } else if(document.addNEWS.title2.value=="") { alert("作者不能为空!"); document.addNEWS.title2.focus(); return false; } else if( document.addNEWS.ok[0].checked==true ) //如果是选择了图片新闻 { //alert( document.addNEWS.file2.value ); for (i=1;i<=document.addNEWS.picuploadcount.value;i++) { if (document.getElementById('file'+i).value=='' ) { kong=kong+1; } else { //alert( document.getElementById('file'+i).value ); //这要修改 } } if (document.addNEWS.picuploadcount.value==kong) { alert('你选择了新闻图片,但是还没选择任何图片文件'); return false; } } else { return true; } } function picdisplay() /*单击"是否是图片新闻中的是的时候显示和隐藏"*/ { if ( document.getElementById('shchuan').style.display=='' ) { document.getElementById('shchuan').style.display='none'; } else { document.getElementById('shchuan').style.display=''; }
} function add() /*动态新增*/ { var picuploadcount=document.getElementById('picuploadcount').value; //获取到上传总数 var piccontent=document.getElementById('piccontent').value; //获取上传name内容 var b=1+parseInt(picuploadcount); var a=b; var d=piccontent.split(","); for( i=0;i<=picuploadcount;i++ ) { if( d[i]==b ) { a=b+1; break; } } if (picuploadcount==10) { alert('最多只能上传十张图片'); return false; } var objitem="<span id=\"picupload"+a+"\"><br> <input id=\"file"+a+"\" name=\"file"+a+"\" type=\"file\" size=\"26\" /> 图片说明:<input name=\"remark"+a+"\" type=\"text\" class=\"input\" size=\"30\" /> </span>"; document.getElementById('picupload').insertAdjacentHTML("beforebegin",objitem); document.getElementById('picuploadcount').value=b; //上传总数自加 document.getElementById('piccontent').value=piccontent+a+","; } function del(obj) /*动态减少*/ { var picuploadcount=document.getElementById('picuploadcount').value; //获取到上传总数 var piccontent=document.getElementById('piccontent').value; //获取上传name名 b=obj.split('picupload'); newpiccontent=piccontent.split(b[1]+",").join(""); if (obj=='picupload1') { alert('该项为最初项,不允许删除'); } else { document.getElementById(obj).removeNode(true); document.getElementById('picuploadcount').value=picuploadcount-1; //上传总数自加 document.getElementById('piccontent').value=newpiccontent; //更新新上传name名 } }
</SCRIPT> <? include('top.php')?> <link href="Inc/southidc.css" rel="stylesheet" type="text/css" /> <table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><br /> <table width="90%" border="0" cellpadding="2" cellspacing="1" class="table_southidc"> <form action="News_save.php?News=Add" method="post" enctype="multipart/form-data" name="addNEWS"> <tr> <td class="back_southidc" height="30" colspan="2" align="center">增加新闻</td> </tr> <tr bgcolor="#ECF5FF"> <td width="178" height="25">新闻标题:</td> <td width="676"> <input name="title" type="text" class="input" size="30"></td> </tr> <tr bgcolor="#ECF5FF"> <td height="25">作 者:</td> <td><input name="title2" type="text" class="input" size="30" /></td> </tr> <tr bgcolor="#ECF5FF"> <td height="25">栏 目:</td> <td><label> <select name="modulename"> <?php $sql="SELECT * FROM `af_module` where modulelevel=1"; //查询出所有一级目录 $result=mysql_query($sql); while ( $array=mysql_fetch_array($result) ) { ?> <option style="color:#3366FF;" value="<?=$array['id']?>"> <?=$array['modulename']?></option> <?php $id1=$array['id']; $sql1="SELECT * FROM `af_module` where modulefatherid=$id1"; //查询出所有二级目录 $result1=mysql_query($sql1); while ($array1=mysql_fetch_array($result1)) { if (count($array1)!='1') { ?> <option style="color:#FF0000;" value="<?=$array1['id']?>"> ┠<?=$array1['modulename']?></option> <?php $id2=$array1['id']; $sql2="SELECT * FROM `af_module` where modulefatherid=$id2"; //查询出所有三级目录 $result2=mysql_query($sql2); while ($array2=mysql_fetch_array($result2)) { if (count($array2)!='1') { ?> <option style="color:#339999;" value="<?=$array2['id']?>"> ┠<?=$array2['modulename']?></option> <?php } } } } } ?> </select> <tr bgcolor="#ECF5FF"> <td height="25" valign="top">新闻内容:</td> <td valign="top">
<input type="hidden" name="Content" /><iframe id="eWebEditor1" src="eWebEditor/ewebeditor.htm?id=Content&style=green" frameborder="0" scrolling="No" width="590" height="385"> </iframe> <!--只有这里和编辑器有关-->
</td> </tr> <tr bgcolor="#ECF5FF"> <td height="25" nowrap="nowrap">是否是图片新闻:</td> <td> <input type="radio" name="ok" value="1" > 是 <input name="ok" type="radio" value="0" checked > 否 <font color="#FF0000">选择此项时请注意文章中是否添加有图片 !</font></td> </tr> <tr bgcolor="#ECF5FF"> <td height="25"><span >上传图片:</span></td> <td valign="middle"> <fieldset id="shchuan" style="border-color:#0099FF;display:none;"> <legend><span style="color:#FF0000;">图片上传 <img src="./image/sizeplus.gif" height="15" alt="增加图片" /></span></legend> <input type="hidden" value="1" id="picuploadcount" name="picuploadcount" /> <input type="hidden" value="1," id="piccontent" name="piccontent" /> <div id="picupload"> <span id="picupload1"> <input id="file1" name="file1" type="file" size="26" /> 图片说明:<input name="remark1" type="text" class="input" size="30" /> <!--<img src="./image/sizeminus.gif" height="15" alt="删除图片" />--> </span> </div> </fieldset> </td> </tr> <tr> <td height="30" colspan="2" align="center" bgcolor="#ECF5FF"> <input type="submit" name="Submit" style="border-bottom:#333333; border-bottom-width:1px;border-top:#333333; border-top-width:1px;border-left:#333333; border-left-width:1px;border-right:#333333; border-right-width:1px; background-color:#CCCCCC;" value="提 交" class="input" /> <input type="button" style="border-bottom:#333333; border-bottom-width:1px;border-top:#333333; border-top-width:1px;border-left:#333333; border-left-width:1px;border-right:#333333; border-right-width:1px; background-color:#CCCCCC;" name="Submit" class="input" value="返 回" /> <!--获取EditBox的内容--> <input name=cnWords type=hidden ID="cnWords" value=""> <input name=imageNum type=hidden ID="imageNum" value=""> <input name=editFirstImageName type=hidden ID="editFirstImageName" value=""> <!--获取EditBox的内容--> </td> </tr> </form> <tr> <td height="30" colspan="2" align="center"> </td> </tr> </table></td></tr> </table> <br /> <? require('Inc/foot.php')?>
|
|