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

📄 write.asp

📁 设计考虑校园电子商务模式
💻 ASP
字号:
<%
'****************************************************
' 多多校园                      Power by ddtaobao.com
' Email:ddmaster@126.com               OICQ:136465584 
' Web: http://www.ddtaobao.com              作者:多多
' 校园、企业、医院、公司程序定做,系统开发,网站制作!
' Copyright (C) 2007 ddtaobao.com All Rights Reserved
'****************************************************
%><!--#include file="top.asp"--><TABLE width=778 border=0 cellpadding="0" cellspacing="0" align=center> 
  <TBODY>
    <TR align="center">    <TD vAlign=top  width=182>
<TABLE cellSpacing=0 cellPadding=0 width="182" border=0>
          <TBODY>
            <TR> 
              <TD class=right_title_bs06 align=center>会 员 登 陆</TD>
            </TR>
            <TR> 
              <TD> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR> 
                      <TD >

  <% call ShowUserLogin() %>
</TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
           
        
            
             
            </TABLE>
         </TD><td class=line></td>
         <td width=*>
<SCRIPT language="javascript">
<!--
function checkerr(string)
{
var i=0;
for (i=0; i<string.length; i++)
{
if((string.charAt(i) < '0' || string.charAt(i) > '9') && (string.charAt(i) < 'a' || string.charAt(i) > 'z')&& (string.charAt(i)!='-')) 
{
return 1;
}
}
return 0;//pass
}
function del_space(s)
{
	for(i=0;i<s.length;++i)
	{
	 if(s.charAt(i)!=" ")
		break;
	}

	for(j=s.length-1;j>=0;--j)
	{
	 if(s.charAt(j)!=" ")
		break;
	}

	return s.substring(i,++j);
}

function Submit()
{
	  
		 
	uid = del_space(document.writebook.write.value);
     if (uid.length == 0)
     {
        alert("请输入姓名!");
	return false;
     }
		 	
	email = del_space(document.all("email").value);
     if (email.length == 0)
     {
        alert("请输入Email!");
	return false;
     }
	 
	email = del_space(document.all("email").value);
     if (email.indexOf("@")==-1)
     {
        alert("Email地址无效!");
	return false;
     }
	 
	email = del_space(document.all("email").value);
     if (email.indexOf(".")==-1)
     {
        alert("Email地址无效!");
	return false;
     }
     


     tishi = del_space(document.writebook.title.value);
     if (tishi.length == 0)
     {
        alert("请输入留言标题");
        return false;
     }
	 
	 tsda = del_space(document.writebook.content.value);
     if (tsda.length == 0)
     {
        alert("请输入留言内容!");
        return false;
     }	
	 	 
	 return true;
}
//-->
</SCRIPT>
<%
  With Response
.Write"<table cellpadding=0 cellspacing=1 class=tableborder1 align='center' width='100%' >" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='100%' height='25' class=tablebody1>&nbsp;您现在的位置:<a href='index.asp'>网站首页</a>&gt;&gt;<a href='book.asp'>意见留言</a></td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"<table border='0' width='100%' cellspacing='0' cellpadding='0'>" & Vbcrlf
.Write"	<tr>" & Vbcrlf
.Write"		<td  class=tablebody1>" & Vbcrlf
.Write"		<p align='right'>" & Vbcrlf
.Write"		<a href=book.asp><img border='0' src='images/view.gif' ></a></td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"<table cellpadding=0 cellspacing=1 class=tableborder1 align='center'>" & Vbcrlf
.Write"<form method=post  action=write.asp name=writebook  onSubmit='return Submit()'>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;名称:</td>" & Vbcrlf
.Write"		<td  height='25'  class=tablebody1>&nbsp;<input type='text' name='write' maxlength=10 size='20'> </td>" & Vbcrlf
.Write"		<td width='15%' height='25'  class=tablebody1>" & Vbcrlf
.Write"		<p align='center'>头像选择</td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;主页:</td>" & Vbcrlf
.Write"		<td  height='25' class=tablebody1 >&nbsp;<input type='text' name='home' maxlength=40 size='40'> </td>" & Vbcrlf
.Write"		<td width='15%' height='25'  class=tablebody1>" & Vbcrlf
.Write"		<p align='center'> "
.Write"<select name='face1' class='box' id='face1' onChange=document.images['face'].src=options[selectedIndex].value;>" & Vbcrlf
dim i,facestr,face 
 face="images/face/1.gif"
		  for i=1 to 60
.Write"<option "
			facestr="images/face/" & i & ".gif"
.Write"value='" & facestr &"'>头像" &i &"</option>" & Vbcrlf
			next
.Write"</select></td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;Q Q:</td>" & Vbcrlf
.Write"		<td  height='25'  class=tablebody1>&nbsp;<input type='text' name='qq' maxlength=10 size='40'> </td>" & Vbcrlf
.Write"		<td width='15%' height='75' rowspan='3'  class=tablebody1>" & Vbcrlf
.Write"		<p align='center'> <img id=face src="&face&" alt='选择头像'></td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;E-mail:</td>" & Vbcrlf
.Write"		<td width='47%' height='25'  class=tablebody1>&nbsp;<input type='text' name='email' maxlength=40 size='40'> </td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;是否隐藏:</td>" & Vbcrlf
.Write"		<td width='47%' height='25' class=tablebody1 colspan='2' >&nbsp;<input type='radio' value='1' name='show'>&nbsp;是&nbsp;<input type='radio' value='0' checked name='show'>&nbsp;否 </td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='50'  class=tablebody1>&nbsp;心情图片:</td>" & Vbcrlf
.Write"	<td  height='50' colspan='2' valign='top'  class=tablebody1>" & Vbcrlf
.Write"		&nbsp;<input type='radio' name='emot' value='images/emot/01.gif' checked><img border='0' src='images/emot/01.gif' width='19' height='19'>&nbsp;"
.Write"		<input type='radio' name='emot' value='images/emot/02.gif'><img border='0' src='images/emot/02.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/03.gif'><img border='0' src='images/emot/03.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/04.gif'><img border='0' src='images/emot/04.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/05.gif'><img border='0' src='images/emot/05.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/06.gif'><img border='0' src='images/emot/06.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/07.gif'><img border='0' src='images/emot/07.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/08.gif'><img border='0' src='images/emot/08.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/09.gif'><img border='0' src='images/emot/09.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/10.gif'><img border='0' src='images/emot/10.gif' width='19' height='19'><br>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/11.gif'><img border='0' src='images/emot/11.gif' width='19' height='19'>&nbsp;"
.Write"&nbsp;<input type='radio' name='emot' value='images/emot/12.gif'><img border='0' src='images/emot/12.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/13.gif'><img border='0' src='images/emot/13.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/14.gif'><img border='0' src='images/emot/14.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/15.gif'><img border='0' src='images/emot/15.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/16.gif'><img border='0' src='images/emot/16.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/17.gif'><img border='0' src='images/emot/17.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/18.gif'><img border='0' src='images/emot/18.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/19.gif'><img border='0' src='images/emot/19.gif' width='19' height='19'>&nbsp;"
.Write"<input type='radio' name='emot' value='images/emot/20.gif'><img border='0' src='images/emot/20.gif' width='19' height='19'></td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr ><input type='hidden' name='action' maxlength=20 size='40' value='save'>" & Vbcrlf
.Write"		<td width='20%' height='25' class=tablebody1 >&nbsp;留言标题:</td>" & Vbcrlf
.Write"		<td width='85%' height='25'  class=tablebody1 colspan='2' >&nbsp;<input type='text' name='title' maxlength=20 size='40'> </td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='20%' height='25'  class=tablebody1>&nbsp;留言内容</td>" & Vbcrlf
.Write"		<td width='85%' height='25' colspan='2'  class=tablebody1>&nbsp;<textarea rows='11' name='content' cols='60'></textarea><br>1000个字符以内,不支持Html </td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"	<tr >" & Vbcrlf
.Write"		<td width='100%' height='25' colspan='3'  class=tablebody1><p align='center'><input type=submit value='提 交'>&nbsp;&nbsp; <input type=reset value='取 消'> </td>" & Vbcrlf
.Write"	</tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"</form>" & Vbcrlf

dim action1,write1,home1,qq1,email1,show1,emot1,face1,title1,content1
action1=trim(request("action"))
write1=HTMLEncode(trim(request("write")))
home1=HTMLEncode(trim(request("home")))
qq1=HTMLEncode(trim(request("qq")))
email1=HTMLEncode(trim(request("email")))
show1=HTMLEncode(trim(request("show")))
face1=HTMLEncode(trim(request("face1")))
emot1=HTMLEncode(trim(request("emot")))
title1=HTMLEncode(trim(request("title")))
content1=HTMLEncode(trim(request("content")))
if action1="save" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from [dd_book] "
rs.open sql,conn,1,3
rs.addnew
rs("write")=write1
if home1="" then
rs("home")="about:blank"
else
rs("home")=home1
end if
rs("qq")=qq1
rs("email")=email1
rs("show")=show1
rs("emot")=emot1
rs("face")=face1
rs("title")=title1
rs("content")=content1
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
rs.update
.Write"<script>alert(""留言成功,请等待审核!"");location.href=""book.asp"";</script>" & Vbcrlf
rs.close
end if
end with
%></td></tr></TBODY>
        </TABLE>
     
<!--#include file="bottom.asp"-->

⌨️ 快捷键说明

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