<!-- #include file="../inc/lib.inc" -->
<!-- #include file="../inc/database.inc" -->
<!-- #include file="../inc/open_cn.inc" -->
<!-- #include file="path.inc" -->
<!--#include file="../inc/articlechar.inc"-->
<%
dim listname
dim typename
dim title
dim content
dim sql
dim rs
dim filename
dim articleid
dim outfile
Set Upload = Server.CreateObject("Persits.Upload")
' We must call Upload.Save or SaveToMemory before we can use Upload.Form!
Upload.SetMaxSize 1024*1024, False 
Upload.Save server.MapPath("file/")if Upload.Form("qfr")="" then w "未选择签发人!"
if Upload.Form("txttitle")="" then w "未填写标题!"
title=htmlencode2(Upload.Form("txttitle"))
subtitle=htmlencode2(Upload.Form("subtitle"))
content=htmlencode2(Upload.Form("txtcontent"))set rs=server.createobject("adodb.recordset")
sql="select max(id) as maxid from ggl_nr"
rs.open sql,cn
if isnull(rs("maxid")) then
articleid=1
else
articleid=rs("maxid")+1
end if
'w articleid
rs.close
set rs=nothingset rs=server.createobject("adodb.recordset")
sql="select * from ggl_nr"
rs.open sql,cn,1,3rs.addnew
rs("hyzcr")=Upload.Form("hyzcr")
rs("zbt")=title
rs("fbt")=subtitle
rs("nr")=content
rs("fbsj")=date()
rs("id")=articleid'------------------------
read=packtxtlist(Upload.Form("read"))
rs("reader")=read
rs("sign_n")=read
rs("sign_y")=""
rs("tzrs")=txtelements(read)
rs("wqds")=txtelements(read)
'------------------------
rs("wentou")=Upload.Form("wentou")
if Upload.Form("wenhao")="" then
rs("wenhao")=0
else
rs("wenhao")=Upload.Form("wenhao")
end if
if Upload.Form("qihao")="" then
rs("qihao")=0
else
rs("qihao")=Upload.Form("qihao")
end ifrs("lmbh")=session("lmbh")
rs("author")=session("yhmc")
rs("fbdw")=session("bmmc")
rs("qfr")=Upload.Form("qfr")
'rs("keys")=Upload.Form("key")
if trim(Upload.Form("link"))<>"http://" then rs("link")=trim(Upload.Form("link"))
For Each File in Upload.Files 

If File.Name = "myfile" Then 
rs("files") = File.path
End If 
If File.Name = "myfile1" Then 
rs("files1") = File.path
End If 
If File.Name = "myfile2" Then 
rs("files2") = File.path
End If  If File.Name = "myphoto" Then 
rs("photo") = File.path
End If 
If File.Name = "myphoto1" Then 
rs("photo1") = File.path
End If 
If File.Name = "myphoto2" Then 
rs("photo2") = File.path
End If  'If File.ImageWidth > 150 Then 
'If File.ImageHeight > 200 Then 
Next rs.update
rs.close
set rs=nothing%><head>
</head><div align="center">
  <table border="1" cellspacing="0" width="50%" bgcolor="#F0F8FF" bordercolorlight="#11B1FF" bordercolordark="#F0F8FF">
    <tr>
      <td width="100%" bgcolor="#0080C0" height="20">
        <p align="center"><font color="#FFFFFF"><b>添加文章成功</b></font></td>
    </tr>
    <tr>
      <td width="100%">
        <p align="left"><br>
        其文件序号为:<%response.write articleid%><br>
        文件标题为:<%response.write title%></p>
    <center>
    <p align="center">是否继续添加?<br>
    <br>
    <a href="addarticle.asp">
    是</a>&nbsp;&nbsp; <a href="list.asp?lmbh=<%=session("lmbh")%>">否</a><br>
    <br>
    </p>
        </td>
    </tr>
    </table>
</div>
<!-- #include file="../inc/close_cn.inc" -->