new.asp

来自「个人主页全站v2.0 个人主页全站v2.0 个人主页全站v2.0」· ASP 代码 · 共 338 行 · 第 1/2 页

ASP
338
字号
<!--#include file="config.asp"-->
<!--#include file="check.asp"-->
<%
on error resume next

set rs = server.createobject("adodb.recordset")
sql = "select * from config"
rs.open sql,conn,1,1

if date <> idate then
rs("today") = 0
end if
rs("date") = date
rs.update

rs.close

iaction = request.form("action")

if iaction = "new" then
iname = inohtml(request.form("name"))
iemail = inohtml(request.form("email"))
iweb = inohtml(request.form("homepage"))
ioicq = inohtml(request.form("oicq"))
iicon = inohtml(request.form("icon"))
iface = inohtml(request.form("face"))
icontent = inohtml(request.form("content"))
ititle = inohtml(request.form("title"))

if iname = "" or icontent = "" or ititle = "" then
ierror = ierror & "有未填栏"
end if

if iemail <> "" and isvalidemail(iemail) = false then
ierror = ierror & "邮箱格式错误"
end if

if ioicq <> "" and ( isinteger(ioicq) = false or len(ioicq) < 4 or len(ioicq) > 11 ) then
ierror = ierror & "QQ格式错误"
end if

if iweb = "http://" or iweb = "" then
iweb = "http://www.landao.com"
end if

if iface = "" or iface > 6 then
iface = 1
end if

if iicon = "" or iicon > 26 then
iicon = 1
end if

if len(icontent) > imax then
ierror = ierror & "内容字数过多"
end if

if len(iname) > 100 or len(iemail) > 100 or len(iweb) > 100 or len(ititle) > 100 or len(iicon) > 100 or len(iface) > 100 then
ierror = ierror & "信息过长"
end if

if ierror = "" then
sql = "select * from content"
rs.open sql,conn,3,2
rs.addnew
rs("author") = iname
rs("email") = iemail
rs("oicq") = ioicq
rs("homepage") = iweb
rs("content") = icontent
rs("icon") = iicon
rs("face") = iface
rs("time") = now
rs("title") = ititle
rs.update
rs.close

sql = "select * from config"
rs.open sql,conn,3,2
if date <> idate then
rs("today") = 1
else
rs("today") = rs("today") + 1
end if
rs("date") = date
rs.update
rs.close

set rs = nothing
response.redirect "index.asp"
response.end

end if

end if
%>
<html>

<head>
<!--- The site is designed by Wind Song Studio --->
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="webmaster@i986.com">
<meta name="description" content="风雅颂工作室,Wind Song Studio.">
<meta name="keywords" content="风雅颂,工作室,设计,Studio,Wind,Song,Design">
<link href="style.css" rel="stylesheet" type="text/css">
<title><%=ititle%></title>
<base target="_blank">
</head>

<body bgcolor="#EEEEEE" topmargin="0" leftmargin="0">
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800">
    <tr>
      <td width="100" background="images/main/left.gif"> </td>
      <td width="600" bgcolor="#cea772">
      <img border="0" src="images/main/top.jpg"></td>
      <td width="100" background="images/main/right.gif"> </td>
    </tr>
  </table>
  </center>
</div>

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800" height="100%" bgcolor="#e4c59a">
    <tr>
      <td width="100" background="images/main/left.gif"> </td>
      <td width="600" bgcolor="#e4c59a" valign="top">
      <div align="center">
        <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="580" height="54">
        <tr>
          <td width="100%" align="center" colspan="5" height="32">
          <table border="0" width="100%" cellspacing="0" cellpadding="0">
            <tr>
              <td width="100%">
                <table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
                  <tr>
                    <td width="12%" align="center" height="36"></td>
                    <td width="12%" align="center" height="36"><a href="../index.htm"><img border="0" src="../img/index.gif" align="left" width="50" height="20"></a></td>
                    <td width="12%" align="center" height="36"><a href="./"><img border="0" src="../img/xc.gif" align="left" width="50" height="20"></a></td>
                    <td width="12%" align="center" height="36"><a href="../music/"><img border="0" src="../img/y.gif" align="left" width="50" height="20"></a></td>
                    <td width="13%" align="center" height="36"><a href="../diary/"><img border="0" src="../img/rj.gif" align="left" width="50" height="20"></a></td>
                    <td width="13%" align="center" height="36"><a href="./"><img border="0" src="../img/gb.gif" align="left" width="50" height="20"></a></td>
                    <td width="13%" align="center" height="36"><a href="http://www.landao.com/bbs/" target="_blank"><img border="0" src="../img/bbs.gif" align="left" width="50" height="20"></a></td>
                    <td width="13%" align="center" height="36"><a href="../link/"><img border="0" src="../img/link.gif" align="left" width="50" height="20"></a></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr>
          <td width="5%" align="center" height="22">
          <img border="0" src="images/main/now.gif"></td>
          <td width="35%" height="22">
          </td>
          <td width="20%" align="center" height="22">
          <a href="new.asp"><img border="0" src="images/main/new.jpg"></a></td>
          <td width="20%" align="center" height="22">
          <a href="index.asp">
          <img border="0" src="images/main/list.jpg"></a></td>
          <td width="20%" align="center" height="22">
          <a href="manage.asp">
          <img border="0" src="images/main/manage.jpg"></a></td>
        </tr>

⌨️ 快捷键说明

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