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

📄 guestbook.asp

📁 网络书生留言本单用户 v1.0 正式版源码,大家下了就知道怎么用了!
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Gbconn.asp" -->
<!--#include file="eof.asp" -->
<SCRIPT language=javascript id=QzeNet>
<!--
function GbAdd_onsubmit() 
{
  if(document.GbAdd.g_name.value.length==0)
 {
   alert("您必须输入您的昵称!");
   document.GbAdd.g_name.focus();
   return false;
 }
     var name = ">'!%<\/#?";
  for (i=0; i< document.GbAdd.g_name.value.length; i++)
 {
   var CheckChar = document.GbAdd.g_name.value.charAt(i);
   if (name.indexOf(CheckChar) != -1)
     {
       alert("您输入的昵称含有非法字符!");
       document.GbAdd.g_name.focus();
       return false;
     }
 } 
   if(document.GbAdd.g_email.value.length==0)
 {
   alert("您必须输入您的Email地址!");
   document.GbAdd.g_email.focus();
   return false;
 }
   if (document.GbAdd.g_email.value.indexOf("@")==-1 || document.GbAdd.g_email.value.indexOf(".")==-1)
 {
	 alert("请输入正确的Email地址!"); 
	 document.GbAdd.g_email.focus();
	 return false; 
 }
    var Email = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz0123456789-_@.";
  for (i=0; i< document.GbAdd.g_email.value.length; i++)
 {
   var CheckChar = document.GbAdd.g_email.value.charAt(i);
   if (Email.indexOf(CheckChar) == -1)
     {
       alert("您输入的Email格式非法!");
       document.GbAdd.g_email.focus();
       return false;
     }
 }	
    var Page = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz0123456789-_./:";
  for (i=0; i< document.GbAdd.g_page.value.length; i++)
 {
   var CheckChar = document.GbAdd.g_page.value.charAt(i);
   if (Page.indexOf(CheckChar) == -1)
     {
       alert("您输入的主页地址格式非法!");
       document.GbAdd.g_page.focus();
       return false;
     }
 } 
     var QQ = "0123456789 ";
  for (i=0; i< document.GbAdd.g_oicq.value.length; i++)
 {
   var CheckChar = document.GbAdd.g_oicq.value.charAt(i);
   if (QQ.indexOf(CheckChar) == -1)
     {
       alert("您输入的QQ格式非法!");
       document.GbAdd.g_oicq.focus();
       return false;
     }
 }  
   if(document.GbAdd.g_content.value.length==0)
 {
   alert("您必须输入您的留言内容!");
   document.GbAdd.g_content.focus();
   return false;
 }
    if(document.GbAdd.g_content.value.length>600)
 {
   alert("您输入留言内容超过600字!");
   document.GbAdd.g_content.focus();
   return false;
 }	
}

//-->
</SCRIPT>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="tableg1">
<Form language=javascript name="GbAdd" method="post" action="save.asp" onsubmit="return GbAdd_onsubmit()">
  <tr> 
    <td>
	<table width="100%" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="300"> 
              <table width="100%" border="0">
              <tr valign="bottom"> 
                  <td width="7%" height="25" align="center">
				  <%if request.Cookies("qzenetgbuser")<>"" then
				        response.Write("<img src='images/user.gif' width='16' height='18'>")
				      else
					    response.Write("<img src='images/guest.gif' width='16' height='16'>")
				   end if%>
                  </td>
                <td width="18%" height="25">昵称:</td>
                <td width="75%" height="25"><input name="g_name" type="text" id="g_name" size="20" maxlength="16" <%if request.Cookies("qzenetgbuser")<>"" then response.Write("value='"&u_name&"'")%>>
                    [1-16字]</td>
              </tr>
              <tr valign="bottom">
                <td height="25" align="center"><img src="images/email.gif" width="16" height="18"> 
                </td>
                <td height="25">Email:</td>
                  <td height="25"> <input name="g_email" type="text" id="g_email2" size="20" maxlength="50" style="ime-mode:disabled" <%if request.Cookies("qzenetgbuser")<>"" then response.Write("value='"&u_email&"'")%>>
                    [&lt; 50字]</td>
              </tr>
              <tr valign="bottom"> 
                <td height="25" align="center"><img src="images/page.gif" width="16" height="18"> 
                </td>
                <td height="25">主页:</td>
                <td height="25"> <input name="g_page" type="text" id="g_page" size="20" maxlength="250" <%if request.Cookies("qzenetgbuser")<>"" then response.Write("value='"&u_pageurl&"'")%>>
                    [&lt; 50字]</td>
              </tr>
              <tr valign="bottom"> 
                <td height="25" align="center"><img src="images/qq.gif" width="16" height="18"> 
                </td>
                <td height="25">OICQ:</td>
                <td height="25"> <input name="g_oicq" type="text" id="g_oicq" size="20" maxlength="16" <%if request.Cookies("qzenetgbuser")<>"" then response.Write("value='"&u_oicq&"'")%>>
                    [&lt; 10位]</td>
              </tr>
              <tr valign="bottom"> 
                <td height="25" align="center"><img src="images/address.gif" width="16" height="18"></td>
                <td height="25">来自:</td>
                <td height="25"> <select name="g_address" size="1" id="g_address" style="width:80px">
                      <option selected value="四川绵阳">四川绵阳
                    <option value="北京">北京 
                    <option value="广东">广东 
                    <option value="上海">上海 
                    <option value="新疆">新疆 
                    <option value="辽宁">辽宁 
                    <option value="广西">广西 
                    <option value="海南">海南 
                    <option value="湖南">湖南 
                    <option value="甘肃">甘肃 
                    <option value="河北">河北 
                    <option value="湖北">湖北 
                    <option value="江西">江西 
                    <option value="江苏">江苏 
                    <option value="西藏">西藏 
                    <option value="山东">山东 
                    <option value="浙江">浙江 
                    <option value="安徽">安徽 
                    <option value="吉林">吉林 
                    <option value="黑龙江">黑龙江 
                    <option value="山西">山西 
                    <option value="云南">云南 
                    <option value="贵州">贵州 
                    <option value="福建">福建
                    <option value="陕西">陕西 
                    <option value="重庆">重庆 
                    <option value="天津">天津 
                    <option value="河南">河南 
                    <option value="青海">青海 
                    <option value="宁夏">宁夏 
                    <option value="台湾">台湾 
                    <option value="香港">香港 
                    <option value="澳门">澳门 
                    <option value="其它地区">其它地区 
                    <option value="天外来客">天外来客 
                  </select>
                  请选择您的省份:)</td>
              </tr>
              <tr valign="bottom"> 
                <td height="25" align="center"><img id=faceid src="face/1.gif" alt='个人形象代表' width="24" height="24"></td>
                <td height="25">头像:</td>
                <td height="25"> <select name="g_face" size=1 id="g_face" style="width:80px" onChange="document.images['faceid'].src=options[selectedIndex].value">
                      <%
                for i=1 to 10
                response.Write("<option select value=face/"&i&".gif>头像"&i&"")
                next
                %>
                    </select>
                    <a href="face/faces.htm" target="_blank" class="g">点击查看所有头像!</a></td>
              </tr>
            </table>
            </td>
          <td width="300" valign="top"><table width="100%" border="0">
              <tr> 
               <td><img src="images/content.gif" width="16" height="16"><strong>留言内容:</strong> 
                    [ 支持 UBB 语法 ]</td>
              </tr>
              <tr> 
                <td><textarea name="g_content" cols="39" rows="4" id="g_content"></textarea></td>
              </tr>
              <tr> 
                <td><strong>注意:</strong><br>
                  留言者不能发布任何不符合当地法规、国家、国际法律的内容;(详情请浏览ok.njzx.net)不得发布任何非法的、骚扰性的、中伤他人、恐吓、伤害、庸俗,淫秽等信息资料。
                </td>
              </tr>
              <tr> 
                <td align="right" class="s_gb"><%="<strong>·"&u_page&"·</strong> — "&FormatDateTime(now,1)%></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
      <td height="20">
<table width="100%" height="20" border="0" cellpadding="0" cellspacing="0" class="tdg1">
          <tr> 
            <td width="290" align="right">
<input type="hidden" name="ipset" value="<%=u_ipset%>">
           </td>
            <td width="100" class="s_in">
			<input name="g_se" type="checkbox" id="g_se" value="yes">
              悄悄话!</td>
            <td width="200">
			<input type="submit" name="Submit" value="写好了" style="height:20px">&nbsp;&nbsp;
			<input type="reset" name="Submit2" value="重新写" style="height:20px">
            </td>
          </tr>
        </table>
      </td>
  </tr>
 </form>
</table>
<%
dim search,countnum,pagenum,mpage,pageno,loopno

pageno=request("pageno")
search=request.Form("keyword")
set rs=server.createobject("adodb.recordset")
if search="" then
		sql="select * from gb order by id desc"
else
   if request.Cookies("qzenetgbuser")<>"" then
		sql="select * from gb where (g_name like '%"&search&"%' or g_content like '%"&search&"%') order by id desc"
   else
		sql="select * from gb where g_se=false and (g_name like '%"&search&"%' or g_content like '%"&search&"%') order by id desc"
   end if
end if
rs.open sql,conn,1,1

⌨️ 快捷键说明

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