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

📄 urladd.asp

📁 单班同学录 一个非常漂亮的同学录 哦
💻 ASP
字号:
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<!--#include file="SESSION.asp" -->
<!--#include file="CONN.asp" -->
<%
if request.ServerVariables("REQUEST_METHOD")="POST" then
	if session("usergroup")=1 then
		response.write"<script>alert('对不起,您还没有经过同学验证,无权发布消息!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
		response.end
	end if
	urlid=trim(request.Form("urlid"))
	urlname=trim(request.Form("urlname"))
	urladdr=trim(request.Form("urladdr"))
	
	if left(urladdr,7)<>"http://" then
		urladdr="http://"&urladdr
	end if
	UrlText=replace(trim(request.Form("UrlText")),"'","")
	if urlid="" then '增加网址
		strsql="insert into url (urlname,urladdr,urluser,urlText,urltime) values('"&urlname&"','"&urladdr&"','"&session("username")&"','"&UrlText&"',now())"
		conn.execute(strsql)
		response.Redirect("urlview.asp")
	else '修改网址
		strsql="update url set urlname='"&urlname&"',urladdr='"&urladdr&"',UrlText='"&UrlText&"' where urlid="&urlid
		conn.execute(strsql)
		CloseDatabase
		response.Redirect("urlview.asp")
	end if
end if

id=request.QueryString("id")
if id<>"" then
	strsql="select * from url where urlid="&id
	set rs=conn.execute(strsql)
	If rs("UrlUser")=Session("Username") or session("usergroup")=3 Then
		urlid=rs("urlid")
		urlname=rs("urlname")
		urladdr=rs("urladdr")
		UrlText=rs("UrlText")
	Else
		response.Redirect("error.asp")
	End If
end if
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=classname%>同学录--添加网址</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform()
	{if  (document.form1.urlname.value.length==0) {
	alert("请填写网站地址!");
	document.form1.urlname.focus();
	return false;
	}
	if  (document.form1.urladdr.value.length==0) {
	alert("请填写网站地址!");
	document.form1.urladdr.focus();
	return false;
	}
	if  (document.form1.UrlText.value.length==0) {
	alert("请填写网站介绍!");
	document.form1.UrlText.focus();
	return false;
	}
	if  (document.form1.UrlText.value.length>200) {
	alert("您发表的留言大于所规定字数!");
	document.form1.UrlText.focus();
	return false;
	}
	return true
	}
//-->
</script>
</head>

<body background="images/1.GIF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="3"><img src="images/top_t.gif" width="776" height="43"></td>
  </tr>
  <tr> 
    <td width="138"><img src="images/top_l.gif" width="138" height="39"></td>
    <td width="584" align="right" bgcolor="#666B52"><a href="index.asp"><img src="images/toplogo.gif" alt="<%=classname%>同学录" width="200" height="39" border="0"></a></td>
    <td width="54"><img src="images/top_r.gif" width="54" height="39"></td>
  </tr>
  <tr> 
    <td colspan="3"><table width="776" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="120" rowspan="2" valign="top" background="images/left_x.gif"><img src="images/left_img.gif" width="120" height="480"></td>
          <td rowspan="2" valign="top" bgcolor="#F2F2EA"> <div align="center"> 
              <!--#include file="top.asp" -->
            </div>
            <table width="618" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td valign="top"> <div align="center"><br>
                    <!--#include file="left.asp" -->
                  </div></td>
                <td width="10">&nbsp;</td>
                <td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="2" class="font1">
                    <tr> 
                      <td width="459">您的位置&gt;添加网址</td>
                      <td width="27"> </td>
                    </tr>
                  </table>
                  <div align="center"> 
                    <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/gnymtbz.gif">
                            <tr> 
                              <td width="135"><img src="images/tjwz.gif" width="135" height="36"></td>
                              <td>&nbsp;</td>
                              <td width="100"><img src="images/gnymtyb.gif" width="100" height="36"></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr> 
                        <td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/n_bk.gif">
                            <tr> 
                              <td valign="top"><form action="urladd.asp" method="post" name="form1" id="form1" onSubmit="return checkform()">
                                  <table width="390" border="0" align="center" cellpadding="2" class="font1">
                                    <tr> 
                                      <td> <table width="380" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#666B52">
                                          <tr> 
                                            <td><table width="100%" border="0" cellpadding="2" cellspacing="1">
                                                <tr bgcolor="#FFFFFF"> 
                                                  <td width="100" align="center" bgcolor="#E3E3CF"><strong>网站名称:</strong></td>
                                                  <td bgcolor="#f1f1eb"> <input name="urlname" type="text" class="input-box" id="urlname22" value="<%=urlname%>" size="36" height="20"> 
                                                  </td>
                                                </tr>
                                                <tr bgcolor="#FFFFFF"> 
                                                  <td align="center" bgcolor="#E3E3CF"><strong>网站地址:</strong></td>
                                                  <td bgcolor="#f1f1eb"><input name="urladdr" type="text" class="input-box" id="urladdr22" value="<%=urladdr%>" size="36" height="20"> 
                                                  </td>
                                                </tr>
                                                <tr bgcolor="#FFFFFF"> 
                                                  <td align="center" valign="top" bgcolor="#E3E3CF"><strong><br>
                                                    网站说明:<br>
                                                    </strong><font color="#FF0000"><br>
                                                    不要超过<br>
                                                    100个字符</font></td>
                                                  <td bgcolor="#f1f1eb"> <textarea name="UrlText" cols="40" rows="8" class="input-box" id="textarea3"><%=UrlText%></textarea> 
                                                  </td>
                                                </tr>
                                              </table></td>
                                          </tr>
                                        </table>
                                        
                                      </td>
                                    </tr>
                                    <tr> 
                                      <td><DIV align=center> 
                                          <input name="urlid" type="hidden" id="urlid" value="<%=urlid%>">
                                          <input type="submit" name="Submit" value="提交">
                                          <input type="reset" name="Submit2" value="重置">
                                        </DIV></td>
                                    </tr>
                                  </table>
                                  </form></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr> 
                        <td><img src="images/n_foot.gif" width="400" height="10"></td>
                      </tr>
                    </table>
                  </div></td>
              </tr>
            </table></td>
          <td width="38" valign="top" background="images/right_b.gif"><img src="images/right_b.gif" width="38" height="5"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="3"><img src="images/z_f.gif" width="776" height="26"></td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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