www.gusucode.com > 学校共青团组织网站源代码 > 学校共青团组织网站源代码/626/Utg.asp

    <STYLE type="text/css">
<!--
a:link {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited {text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: Verdana, 宋体, MingLiU; 
TEXT-DECORATION: underline
}
body {font-size: 9pt; font-family: Verdana,宋体,MingLiU, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: Verdana, 宋体, MingLiU, Arial;
color: #000000;line-height: 120%;table-layout:fixed;word-break:break-all
}
p {FONT-SIZE: 9pt; FONT-FAMILY: Verdana, 宋体, MingLiU, Arial;
color: #000000
}
input {FONT-SIZE: 9pt; FONT-FAMILY: Verdana, 宋体, MingLiU, Arial;
color: #000000
}
body {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select {FONT-SIZE: 9PT;font-family: Verdana,宋体}
option {FONT-SIZE: 9pt;font-family: Verdana,宋体}
textarea {FONT-SIZE: 9pt;font-family: Verdana,宋体}
-->
</STYLE>
<!--#include file = admin_conn.asp -->
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [config]",conn,1,1
if rs.recordcount<>0 then
  tgtop=rs("tgtop")
  tgbottom=rs("tgbottom")
  tghtmledit=rs("tghtmledit")
end if
rs.close
set rs=nothing
Response.Write tgtop
%>
<head>

<!--#include file = titleb.asp -->
<!--#include file = edit/Include/DeCode.asp -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
</head>
<%

adduser=chkhtm(trim(Request("adduser")))&"|"&chkhtm(trim(Request("email")))
title=chkhtm(trim(Request("title")))
content=trim(Request("content"))
content=eWebEditor_DeCode(content,"IFRAME,SCRIPT,OBJECT,NOSCRIPT,FORM")
lm=chkhtm(trim(request("lm")))
addtime=date()
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")

if adduser="" or title="" or content="" then 
%>
<table border=0 width=740 align=center><!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.adduser.value == "")
  {
    alert("请在 你的姓名 域中输入值。");
    theForm.adduser.focus();
    return (false);
  }

  if (theForm.adduser.value.length < 2)
  {
    alert("在 你的姓名 域中,请至少输入 2 个字符。");
    theForm.adduser.focus();
    return (false);
  }

  if (theForm.adduser.value.length > 5)
  {
    alert("在 你的姓名 域中,请最多输入 5 个字符。");
    theForm.adduser.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("请在 电子邮件 域中输入值。");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length < 1)
  {
    alert("在 电子邮件 域中,请至少输入 1 个字符。");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length > 50)
  {
    alert("在 电子邮件 域中,请最多输入 50 个字符。");
    theForm.email.focus();
    return (false);
  }

  if (theForm.title.value == "")
  {
    alert("请在 标题 域中输入值。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length < 1)
  {
    alert("在 标题 域中,请至少输入 1 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length > 50)
  {
    alert("在 标题 域中,请最多输入 50 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex < 0)
  {
    alert("请选择“栏目分类”选项中的一项。");
    theForm.lm.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex == 0)
  {
    alert("第一个“栏目分类”选项无效。 请选择其他选项中的一项。");
    theForm.lm.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="?" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript"><tr><td align=center>
	<div align="center">
		<table border="1" cellpadding="3" width="734" id="table1" style="border-collapse: collapse" bordercolor="#C0C0C0">
			<tr>
				<td width="116" align="center">你的姓名</td>
				<td width="360">
				&nbsp;<!--webbot bot="Validation" s-display-name="你的姓名" b-value-required="TRUE" i-minimum-length="2" i-maximum-length="5" --><input type="text" name="adduser" size="23" maxlength="5"></td>
				<td width="244"> </td>
			</tr>
			<tr>
				<td width="116" align="center">电子邮件</td>
				<td width="360">
				&nbsp;<!--webbot bot="Validation" s-display-name="电子邮件" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="50" --><input type="text" name="email" size="36" maxlength="50"></td>
				<td width="244"> </td>
			</tr>
			<tr>
				<td width="116" align="center">标 题</td>
				<td width="360">
				&nbsp;<!--webbot bot="Validation" s-display-name="标题" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="50" --><input type="text" name="title" size="46" maxlength="50"></td>
				<td width="244"> </td>
			</tr>
			<tr>
				<td width="116" align="center">栏 目</td>
				<td width="360">
				&nbsp;<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="lm">
					<option>请选择</option>
					  <%
					  'ON ERROR RESUME NEXT
					   lmid=config("tglm")&",0"
					   nr=split(lmid,",")
					   For i=0 to ubound(nr)
					        aaa=nr(i)
					        if aaa="" then aaa=0
					        'Response.Write aaa
							sql2 = "select * from lm where id="&aaa
							Set rs2 = Server.CreateObject("ADODB.RecordSet")
							rs2.Open sql2,conn,1,1
							while not rs2.eof
							  if rs2("lm")<>"" then
							%>
							   <option value='<%=rs2("id")%>'><%=rs2("lm")%>(1级)</option>
							<%
							  ElseIf rs2("lm2")<>"" then
							%>
							   <option value='<%=rs2("id")%>'> ├ <%=rs2("lm2")%>(2级)</option>
							<%
							  end if
							   	Set rs33 = Server.CreateObject("ADODB.RecordSet")
							   	rs33.Open "select * from [lm] where lm3<>'' and lmid='"&rs2("id")&"' order by id asc",conn,1,1
							   	while not rs33.eof
							   	  nnn=split(lmid,",")
							   	  for k=0 to ubound(nnn)
							   	  'Response.Write rs33("id")&nnn(k)
							   	    if clng(nnn(k))=clng(rs33("id")) then
							%>
								<option value='<%=rs33("id")%>'>  ├ <%=rs33("lm3")%>(3级)</option>
							<%
							        end if
							      next
							   	rs33.movenext
							   	wend
							rs2.movenext
							wend
							rs2.close
							set rs2=nothing
						next
				 
					%>
					
					</select></td>
				<td width="244"> </td>
			</tr>
			<tr>
				<td width="720" align="center" colspan="3">
				&nbsp;<textarea rows="11" style='width:99%' name="content" cols="98"></textarea></td>
			</tr>
		</table>
	</div>
	<p><input type="submit" value="提交" name="B1">    <input type="reset" value="重置" name="B2"></p>

	</td></tr></form></table>
<BR><BR><center>

<%
elseif adduser<>"" and content<>"" and title<>"" and lm<>"" then
  nr=content
  nr=replace(nr,chr(10),"<BR>")
  conn.Execute "insert into [usertougao] ([title],[adduser],[content],[ip],[addtime],[lmid]) values('"&title&"','"&adduser&"','"&nr&"','"&userip&"','"&addtime&"','"&lm&"')"
  Response.Write "<br><BR><BR><center>保存成功,请等待管理审核!</center><BR><BR><BR>"
end if
Response.Write tgbottom
conn.close
set conn=nothing
%>