www.gusucode.com > 新锐领秀网络相册 1.1 > post.asp

    <!-- #Include File="conn.asp"-->
<!--#include file="include/clsUp.asp"-->
<!--#include file="include/aspjpeg.asp"-->
<!--#include file="head.asp"-->
<%
Dim action
action = Request.QueryString("action")
If action = "add_save" Then 
	Dim title,photopath,Content,typeid,hot,rs,sql,FileName
	
	set upfile=new clsUp ''建立上传对象
	upfile.NoAllowExt="asp;exe;htm;html;aspx;cs;vb;js;"	'设置上传类型的黑名单
	upfile.GetData (10240000)   '取得上传数据,限制最大上传10M
	set oFile=upfile.f_i_l_e("photopath")
	FileName = gMakeFileName(now())
	photopath = FileName &"." & oFile.FileExt
	Response.write photopath
	upfile.SaveToFile "photopath",Server.mappath("photos/"&photopath)
	If IsObjInstalled(gJpeg) Then 
		Dim Thumb
		Thumb = FileName & ".thumb." & oFile.FileExt
		gCreateSmallImg Server.mappath("photos/" & photopath),Server.mappath("photos/" & Thumb),gThumbMaxWidth,gThumbMaxHeight,1 
	End If
	title=gCheckStr(upfile.form("title"))
	Content=trim(gCheckStr(upfile.form("Content")))
	typeid=gCheckStr(upfile.form("typeid"))
	set rs=server.createobject("adodb.recordset")
	If Not IsObject(conn) Then Call Connectiondatabase
	sql="select * from gPhotos where id is null"
	rs.open sql,conn,1,3
	rs.addnew
	rs("Title")=title
	rs("PhotoPath")=photopath
	Rs("DateLine")=Now()
	'rs("Description")=Content
	rs("TypeID")=typeid
	rs.update
	rs.close
	set rs=Nothing
	response.write"<script language='javascript'>alert('系统提示:发布成功!')</script>"
	response.Write "<meta http-equiv=refresh content=0;URL=post.asp>"
	response.end
End If 
%>
<table width="778" border="0" cellspacing="0" cellpadding="0" class="maintable" align="center">
	<tr class="header">
		<td height="20" width="100%">添加产品</td>
	</tr>
</table>
<table width="778" class="maintable" align="center">
    <form method="post" action="?action=add_save" name="myform" ENCTYPE="multipart/form-data" onSubmit="return CheckForm();"> 
	 <tr>
      <td width="100%" valign="top" align="center">
      <table width="100%" border="1" cellpadding="5" cellspacing="0" bordercolor="#999999" class="table" id="AutoNumber2" style="border-collapse: collapse">
        <tr class="tr2">
          <td align=left colspan="2"><b><font color="#0C338F">请在以下窗口中完整输入信息内容:</font></b></td>
        </tr>
        <tr>
          <td width="200" align=right>
          图片标题</td>
          <td align="left">
          <input type="text" name="title" size="20"></td>
        </tr>
        <tr>
          <td align="right">
          <font color="#0C338F">图片分类</font></td>
          <td align="left">
            <select name="typeid" size="1">
              <option selected value="">-请选择类别-</option>
					<option value="1">绝色美女</option>
            </select>
          </td>
        </tr>
        <tr >
          <td align="right"><font color="#0C338F">选择图片</font></td>
          <td align="left"><input type="file" name="photopath">
        </td> 
        </tr>
        <tr>
          <td width="200" align="right" valign="top">
          <font color="#0C338F">图片说明</font></td>
          <td width="86%" align="left">
			<textarea name="content"></textarea>
		  </td></tr>
        <tr class="tr2">
          <td height="12" colspan="2" >
          <p align="center">          
          <input type="submit" value="确定增加" name="submit3" class=buttonface>
          <input type="reset" value="清空" name="Reset2" class=buttonface></td>
        </tr>
      </table>
      </td>
    
    <tr>
      <td width="100%" height="12"></td>
    </tr>
</form>    
</table>

<!--#include file="foot.asp"-->