⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fabu.asp

📁 青岛分类信息网整合企业名录.供大家分享
💻 ASP
字号:
<!--#include file="head.asp"-->

<%
action=request.querystring("action")
if action="save" then
dim dtitle,dcolor,dbgcolor1,dcu,dlei,dtext,dstop,dtop,sql,rs
dtitle=HtmlEncode(trim(request.form("dtitle")))
'dcolor=HtmlEncode(trim(request.form("dcolor")))
'dbgcolor1=HtmlEncode(trim(request.form("dbgcolor1")))
dcu=HtmlEncode(trim(request.form("dcu")))
dlei=HtmlEncode(trim(request.form("dlei")))
dtext=HtmlEncode2(request.form("dtext"))
dstop=dateadd("d",request.form("dstop"),date())
if yanzheng=1 then

regjm=replace(trim(Request("regjm")),"'","") 
regjm1=replace(trim(Request("regjm1")),"'","")
if regjm1="" then
	response.write "<script>alert('用户登录出错,下面是产生错误的可能原因:\n\n·请输入认证码');history.go(-1);</Script>"
	Response.End 
elseif regjm<>regjm1 then
	response.write "<script>alert('用户登录出错,下面是产生错误的可能原因:\n\n·认证码输入错误');history.go(-1);</Script>"
	Response.End 
end if
end if

sql="select * from data"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if dtitle<>"" then
rs.addnew
rs("title")=dtitle
rs("color")=dcolor
rs("bgcolor1")=dbgcolor1
rs("cu")=dcu
rs("type")=dlei
rs("text")=dtext
rs("stop")=dstop
rs("mark")=admark
rs("fabuid")="游客"
rs.update
rs.close  
set rs=nothing                                                                                     
conn.close   
set conn=nothing
response.redirect "regok.asp"
end if
end if
%>


<SCRIPT LANGUAGE="JavaScript">
<!--//
function checkadd()
{   
    if (document.postart.dtitle.value.length<1)
	{
        alert("请您填写广告标题!");
        document.postart.dtitle.focus();
        return false;
    }
    if (document.postart.dlei.value=="选择类别")
	{
        alert("请您选择广告类别!");
        document.postart.dlei.focus();
        return false;
    }
    if (document.postart.dtext.value.length<1)
	{
        alert("请您填写广告内容!");
        document.postart.dtext.focus();
        return false;
    }
    if (document.postart.dtext.value.length>80)
	{
        alert("请把广告内容的字数控制在80以内!");
        document.postart.dtext.focus();
        return false;
    }
    if (document.postart.dstop.value=="选择有效期")
	{
        alert("请您选择有效期限!");
        document.postart.dstop.focus();
        return false;
    }

	if (document.postart.regjm1.value==""){
       alert ("请输入您的验证码!");
       document.postart.regjm1.focus();
       return(false);
    }


}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">      
<!-- Begin
maxLen = 80;
function checkMaxInput(form) {
if (form.dtext.value.length > maxLen)
form.remLen.value = 0;
else form.remLen.value = maxLen - form.dtext.value.length;
}
//  End -->
</script>

<!-- 这里是主题 -->
 <div align="center">
  <center>
  <form action="fabu.asp?action=save" method="post" name="postart" onsubmit="return checkadd()">
  <table border="0" width="100%" cellspacing="0" cellpadding="0"> 
    <tr>
      <td width="100%" colspan="3" height="10" valign="top">       
      </td>           
    </tr>           
    <tr>           
      <td width="35%" align="right" height="26">广告标题:</td>           
      <td width="58%" height="26"><input type="text" name="dtitle" size="20" maxlength="10">            
        <font color="#FF0000">* 10字以内</font></td>                                    
      <td width="7%" height="238" rowspan="10" valign="top">
      </td>                            
    </tr>                           
    <tr>                            
      <td width="35%" align="right" height="26">标题加粗:</td>                            
      <td width="58%" height="26"><input type="radio" value="no" name="dcu">否&nbsp; 
        <input type="radio" value="yes" name="dcu" checked>是</td>                                     
    </tr>                                   
    <tr>                     
      <td width="35%" align="right" height="26">广告类别:</td>                                 
      <td width="58%" height="26">                     
      <select name="dlei" size="1"><option selected value="选择类别">选择类别</option>                             
        <%                                 
			set rs_lei = server.createobject("adodb.recordset")                                            
			sql = "select * from type"                                            
			rs_lei.open sql,conn,1,1                                          
			do while not rs_lei.eof                                           
			%>                                         
          <option value="<%=rs_lei("name")%>"><%=rs_lei("name")%></option>                                       
		  <%                                                                        
		  rs_lei.movenext                                        
		  loop                                                
		  rs_lei.close                                       
		  set rs_lei = nothing       
		  conn.close     
          set conn=nothing                        
		  %>                                         
         </select> <font color="#FF0000">*</font>                                     
      </td>                                  
    </tr>                       
    <tr>                               
      <td width="35%" align="right" height="105" rowspan="3">广告内容:</td>                                   
      <td width="58%"><textarea rows="6" name="dtext" cols="30" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"></textarea>                               
        <font color="#FF0000">*&nbsp;80字以内</font></td>                               
    </tr>                                                           
    <tr>                                                         
      <td width="58%" height="26">                            
        <font color="#FF0000">目前还可写 <input readonly type=text name=remLen size=2 maxlength=2 value="80" style="border: 1 solid #888888">                                      
        个字!</font></td>                              
    </tr>                                                        
    <tr>                                   
      <td width="58%" height="26">                          
        <font color="#FF0000">请不要忘记在广告内容中加入联系办法!</font></td>                                
    </tr>                                   
    <tr>                
      <td width="35%" align="right" height="26">有效期限:</td>                  
      <td width="58%" height="26"><select size="1" name="dstop">   
          <option selected value="选择有效期">选择有效期</option>  
          <option value="7">一星期</option>     
          <option value="15">半个月</option>  
          <option value="31">一个月</option>  
          <option value="61">两个月</option>  
          <option value="92">三个月</option> 
          <option value="183">半年</option> 
          <option value="365">一年</option>  
        </select> <font color="#FF0000">*</font>                               
      </td>                
    </tr>
<%if yanzheng=1 then%>	
    <tr>                                                                                                             <td width="35%" align="right" height="26">验 证 码:</td>   
	
<%
randomize timer
regjm=int(rnd*9998)+1%>
 <td width="58%" height="26">
<INPUT maxLength=4 size=6 name=regjm1>
 <input name="regjm" type="hidden" value="<%=regjm%>">&nbsp;<b><%=regjm%></b>&nbsp; 
 <font color="#FF0000">请输入验证字符串</font>
        </td>                                                                                                                                                                        
    </tr> 

<%end if%>
	



    <tr>                     
      <td width="35%" align="right" height="30">                           
      </td>                                                                     
      <td width="58%" align="right" height="30">                          
        <p align="left"><input type="submit" value="提交" name="submit" onClick="return confirm('请您检查是否在广告内容中加入了联系办法!\n\n如果没有,请点击“取消”来补充广告内容!')">&nbsp;  
        <input type="reset" value="取消" name="reset">&nbsp; <input type="button" value="返回" name="back" onclick="javascript:history.back()"></td>                                     
    </tr>                                        
  </table>                           
  </form>                           
</div>                                               


<!-- 这里是主题结束 -->


<!--#include file="foot.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -