<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/UpLoadClass.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
dim errmsg
errmsg=""
dim title,content,pindao,tag,pic,request2

set request2=New UpLoadClass
  request2.SavePath="videoimage/"
  request2.maxsize=307200
  request2.open()

pic=request2.form("pic")
title=trim(ReplaceBadChar(request2.Form("title")))
content=convert(request2.Form("content"))
pindao=request2.Form("pindao")
tag=request2.Form("tag")
movie=request2.form("movie")

if session("movie")="" then session("movie")=movie

'on error resume next

  select case Request2.form("pic_Err")			
	case 1:
		errmsg=errmsg+"<br><li>文件太大，拒绝上传"		
	case 2:
		errmsg=errmsg+"<br><li>文件格式不对，拒绝上传"		
	case 3:
		errmsg=errmsg+"<br><li>文件太大且格式不对，拒绝上传"
  end select

if title="" then errmsg=errmsg+"<br>"+"<li>视频的标题不能为空！"
if invalidch(title) or instr(title,"，")>0  then errmsg=errmsg+"<br>"+"<li>您的标题可能含特殊符号，请检查！"
if len(content)>600 then errmsg=errmsg+"<br><li>视频内容简介不能超过600字！"

if errmsg<>"" then 
 response.Write "<table width=400 align=center><tr><td height=25 style='font-size:12px'>错误信息：</td></tr>"
 response.write("<tr><td style='font-size:12px'>"+ errmsg +"<br></td></tr>")
 response.Write "<tr><td align='center'><input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'></td></tr></table>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from video_info where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("userid")=userid
rst("classid")=pindao
rst("username")=membername
rst("tag")=tag
rst("title")=title
rst("content")=content
rst("movie")=session("movie")
rst("pic")=pic
rst("dtime")=now()
rst("click")=0
rst("score")=0
rst("people")=0
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing

session("movie")=""
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>视频添加成功</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='1;url=selvideo.asp'>
</head>
<table border="0" cellspacing="0" width="100%" cellpadding="0" height="418" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="418" valign="middle" align="center" class="STYLE4">
<b>您所添加的视频文件信息已经提交发送！<a href="selvideo.asp"><font color="#996633">返回</font></a></b></td>
</tr>
</table>
</body>
</html>