📄 edit_xinxi_c.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file=usercookies.asp-->
<link rel="stylesheet" type="text/css" href="1.CSS">
<%
dim rs,sql,id,b,username,user_c,i,c,tupian
i=1
id=trim(request("id"))
username=request.cookies("ijob")("username")
set rs = Server.CreateObject("ADODB.RecordSet")
if request("ijob")="chk" then
call up()
response.end
else
sql="select c from [user] where username='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "参数错误!"
cl
response.end
end if
user_c=rs("c")
if user_c=0 then
response.write "你还没有道具,请先购买道具!"
cl
response.end
end if
rs.close
sql="select c,tupian from [xinxi] where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,1
if rs.eof then
response.write "参数错误!"
cl
response.end
end if
c=rs("c")
if c=1 then
tupian=trim(rs("tupian"))
else
tupian="null.gif"
end if
rs.close
end if
uptu()
%>
<%sub uptu()%>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="1.CSS">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%">
<p align="center">该信息<%if c=1 then%><a target=_blank href="uptupian/<%=tupian%>"><font color=#ff0000><b>已有</b></font></a>(<font color=#0000FF>可直接覆盖</font>)<%else%><font color=#0000FF>没有</font><%end if%>贴图,上传图片(gif,jpg)</td>
</tr>
</table>
<form name="form1" method="post" action="?ijob=chk" enctype="multipart/form-data" >
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="c" value="<%if c=1 then%>1<%else%>0<%end if%>">
<p align="center">
<input type="file" name="file1" value="" size="17"><br>
<input type="submit" value="上传图片" name="B1"><br>
说明:不论上传或修改都会扣除<font color="#0000FF">1</font>个<font color="#0000FF">贴图道具</font>.道具数量:<font color="#FF0000"><%=user_c%></font>个</p>
</form>
<%end sub%>
<%sub up()%>
<%Server.ScriptTimeOut=5000%>
<!--#include file = "ijob.inc"-->
<%
dim upload,file,formElement,formFile,iCount,fileExt,formPath,filename,c_yn,objFSO
iCount=0
username=request.cookies("ijob")("username")
set upload = new sjCat_Upload
Set file = upload.file("file1")
id=upload.form("id")
c_yn=upload.form("c")
if file.filesize<1 then
response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
fileExt=lcase(right(file.filename,4))
if fileEXT<>".gif" and fileEXT<>".jpg" then
response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
if file.filesize>102400 then '这是100K的图片大小数据
response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&fileExt
if file.FileSize>0 then
file.Save2File Server.mappath("uptupian") & "\" & FileName
iCount=iCount+1
end if
set file=nothing
set upload=nothing
set rs=server.createobject("adodb.recordset")
sql = "select tupian from xinxi where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,3
if rs.eof then
response.write "参数错误!"
cl
response.end
else
if c_yn="1" then
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(Server.MapPath("uptupian\"&rs("tupian"))) then
objFSO.DeleteFile(Server.MapPath("uptupian\"&rs("tupian")))
end if
set objFSO=nothing
end if
rs("tupian")=filename
rs.update
end if
rs.close
set rs=nothing
Conn.Execute("Update [user] Set c=c-1 where username='"&username&"'")
closedb
response.write "图片成功上传!"
cl
response.end
%>
<%end sub%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -