<TITLE> 网上理财:文章发表:发表
<?php
include ("cookie_check.php");
$query = "select name from article_area where code=".$area;
$res = mysql_query($query);
$row = mysql_fetch_row($res);
echo $row[0];
?>
</TITLE>
<BODY>
<P ALIGN=CENTER><FONT FACE="隶书" SIZE="7" COLOR="#0000FF">网上理财
</FONT><BR>
<P ALIGN=LEFT>
<FONT FACE="宋体" SIZE="3" COLOR="#0000FF"><A HREF="index.php"
STYLE="Text-Decoration:none">首页</A>>><A HREF="publish.php"
STYLE="Text-Decoration:none">
文章发表</A>>><A HREF="article_publish.php?area=<?php
echo $area ?>" STYLE="Text-Decoration:none">发表<?php echo $row[0] ?>
</A>
<?php
if ($theme)
{$content= str_replace ( "'","mysinglequotes",$content);
$content=htmlspecialchars($content);
$content=nl2br($content);
$theme= str_replace ( "'","mysinglequotes",$theme);
$theme=htmlspecialchars($theme);
$theme=nl2br($theme);
$query = "INSERT INTO article (click_count,user,type,theme,content,
icon,time_open,time_close,answer_count,answer_name,area) VALUES
(1,'".$cookie_user."',3,'".$theme."','".$content."',0,now(),now(),1,'"
.$cookie_user."',".$area.")";
$res = mysql_query($query);
if ($res)
{echo "<script language='javascript'>";
echo "alert('文章已发送至缓冲区,等版主审核后将正式发表');";
echo "parent.location.href='publish.php?area=".$area."'";
echo "</script>";
}
else
{echo "<script language='javascript'>";
echo "alert('文章发表失败');";
echo "parent.location.href='publish.php?area=".$area."'";
echo "</script>";
}
}
?>
<SCRIPT language=JavaScript>
<!--
var submitcount=0;
function check_com(){
if(document.form.theme.value.length ==0){
submitcount--;
alert("文章标题不能为空!
You must supply a subject.");
return false;
}
if(document.form.content.value.length == 0){
submitcount--;
alert("文章正文不能为空!
You must supply a message.");
return false;
}
return true;
}
//-->
</SCRIPT>
<FORM action=article_publish.php method=post name=form
onsubmit="return check_com()">
<TABLE align=center border=0 cellPadding=4 cellSpacing=0
width=100%>
<TBODY>
<TR>
<TD width=70><FONT FACE="宋体" SIZE="3"
COLOR="#0000FF">文章标题</FONT></TD>
<TD width=700><INPUT maxLength=50 name=theme
size=105> </TD>
<TR>
<TD class=mid vAlign=top><FONT FACE="宋体"
SIZE="3" COLOR="#0000FF">文章正文</FONT></TD>
<TD><TEXTAREA cols=103 name=content
rows=14></TEXTAREA> </TD></TR>
</TBODY></TABLE>
<P align=center ><INPUT name=submit
onclick="return checkSubmit()" type=submit value=" 发 表 ">
<INPUT name=reset type=reset value=" 清 除 ">
</TD></TR>
<INPUT TYPE=HIDDEN name=area VALUE="<?php echo $area ?>">
</FORM>
</html>
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一篇:一个网上理财站点的设计(十二)
下一篇:一个网上理财站点的设计(十四)
【文章评论】
【收藏本文】
【推荐好友】
【打印本文】
【我要投稿】 【论坛讨论】
更多相关文章
|
|