ClassicASP 갤러리#7 ( gallery_edit.asp ) 글수정
페이지 정보
본문
<%@ Language=VBScript %>
<% Option Explicit %>
<%
' 작성자: 해피정닷컴 ( https://www.happyjung.com )
' 2008-08-02 : 1차 작성
'
'
'
'
'
'
%>
<!--#include virtual="/inc/db_con.asp" -->
<%
dim str,val ' 해피정닷컴 추가 2008-05-27
' 인젝션 방지관련 https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=480
'function sqlCheck(str)
'...
'end function
'Dim idx : idx=sqlCheck(request("idx"))
Dim Seq, Page, SearchPart, SearchStr
Dim num, name, email, url, title, content, writeday, filename1, filesize1, filename2, filesize2, down1, down2, visit, i_width1, i_height1, ip
Dim NewGetTable : NewGetTable = "hp_gallery"
num = sqlCheck(request("num"))
Seq = sqlCheck(request("seq"))
Page = sqlCheck(request("page"))
SearchPart = sqlCheck(request("SearchPart"))
SearchStr = sqlCheck(request("SearchStr"))
'C_id = Request.Cookies("USER")("C_id")
'C_passwd = Request.Cookies("USER")("C_pw")
num = sqlCheck(request("num"))
'/수정부분 암호 확인 부분
'내용 출력
SQL = "SELECT * from hp_gallery where num="&num
Set rs = Con.execute(SQL)
num = rs("num")
name = rs("name")
email = rs("email")
url = rs("url")
title = rs("title")
content = rs("content")
content = Replace(content, vbCrLf,"<br>")
writeday = rs("writeday")
filename1 = rs("filename1")
filesize1 = rs("filesize1")
down1 = rs("down1")
visit = rs("visit")
i_width1 = rs("i_width1")
i_height1 = rs("i_height1")
ip = rs("ip")
Rs.close
'### 파일의 용량에 따라.. 용량표시를 MB 냐, KB냐, BYTE 냐로 결정하는 부분
if Len(filesize1) > 0 Then
if Clng(filesize1) > 1024000 then
filesize1 = Round((Clng(filesize1)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize1) > 1024 then
filesize1 = Round((Clng(filesize1)/1024)*10)/10&" KByte"
else
filesize1 = filesize1 &" Byte"
end if
end if
if Len(filesize2) > 0 Then
if Clng(filesize2) > 1024000 then
filesize2 = Round((Clng(filesize2)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize2) > 1024 then
filesize2 = Round((Clng(filesize2)/1024)*10)/10&" KByte"
else
filesize2 = filesize2 &" Byte"
end if
end if
'### 작성일을 정리하는 부분.
dim yy, mm, dd, h, mi
yy = year(writeday)
mm = right("0" & month(writeday),2)
dd = right("0" & day(writeday),2)
h = right("0" & hour(writeday),2)
mi = right("0" & minute(writeday),2)
writeday = yy & "년 " & mm & "월 " & dd & "일 (" & h & ":" & mi & ")"
%>
<!--#include file="../inc/_happyjung_.asp"-->
<title>포토갤러리</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript" src="/inc/editor.js"></script>
</head>
<body>
<!-- 게시판 시작 -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form action="gallery_edit_ok.asp" method="post" enctype="multipart/form-data" name="board_edit" id="board_edit">
<input type="hidden" name="num" value="<%= num %>" />
<input type="hidden" name="page" value="<%= page %>" />
<input type="hidden" name="seq" value="<%= seq %>" />
<input type="hidden" name="SearchPart" value="<%= SearchPart %>" />
<input type="hidden" name="SearchStr" value="<%= SearchStr %>" />
<tr>
<td><table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#dadada">
<col width="77">
<col>
<col width="77">
<col>
<tr>
<td align="center" bgcolor="#F6F6F6">제목</td>
<td colspan="3" bgcolor="#FFFFFF"><input name="title" type="text" class="input_box" id="title" value="<%=title%>" size="45" /></td>
</tr>
<tr>
<td align="center" bgcolor="#F6F6F6">작성자</td>
<td width="174" bgcolor="#FFFFFF"><input name="name" type="text" class="input_box" id="name" value="<%=name%>" size="24" /></td>
<td align="center" bgcolor="#F6F6F6">E-Mail</td>
<td width="203" bgcolor="#FFFFFF"><input name="email" type="text" class="input_box" id="email" value="<%=email%>" size="25" /></td>
</tr>
<tr>
<td align="center" bgcolor="#F6F6F6">URL </td>
<td bgcolor="#FFFFFF" colspan="3"><input name="url" type="text" class="input_box" id="url" value="<%=url%>" style="widtdh:100%;" /></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="4" align="center" bgcolor="#F6F6F6"> 내 용</td>
</tr>
<tr align="center">
<td colspan="4" bgcolor="#FFFFFF" style="padding:10 10 10 10;"><textarea class="input_box" style="WIDTH: 100%; HEIGHT: 310px" name="MinBoardContents" border="1"><%=content%></textarea></td>
</tr>
<tr>
<td align="center" bgcolor="#F6F6F6">파일업로드</td>
<td colspan="3" bgcolor="#ffffff"><input name="filename1" type="file" class="input_box" id="filename1" size="20" />
<%
if (filename1 <> "") then
dim FileExt1, x, y, p, Image_width1, FileIcon1
FileExt1 = ucase(right(filename1,3)) ' 확장자 얻기
Select Case FileExt1
Case "BMP", "GIF", "JPG"
FileIcon1 = "ok"
End Select
if FileIcon1 = "ok" then
' 이미지 사이즈를 체크 하는 부분
Sub ImageSize1(ByVal f, ByRef x, ByRef y)
Set p = LoadPicture(f)
x = CLng(CDbl(p.Width) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
y = CLng(CDbl(p.Height) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
Set p = Nothing
End Sub
if len(filename1) <> "" and not isnull(filename1) then
if FileExt1 = "jpg" or FileExt1 = "gif" or FileExt1 = "JPG" or FileExt1 = "GIF" or FileExt1 = "BMP" then
ImageSize1 Server.MapPath("../../")&"\upload\"&filename1, x, y
if x > 660 then
Image_width1 = "660"
else
Image_width1 = x
end if
end if
end if
end if
%>
<%= FILENAME1 %> (<%= FILESIZE1 %>) <br>
삭제
<input type="checkbox" name="DelFile" value="Y" />
체크하시면 기존 파일이 삭제됩니다.
<% end if %></td>
</table></td>
</tr>
<tr>
<td align="center" style="padding:15 0 0 0;"><input name="image" type="image" src="/images/main/bbs_write.gif">
<img src="/images/main/bbs_reset.gif" width="44" height="20" border="0" onClick="reset();" /> <a href="gallery.asp?page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="/images/main/bbs_list.gif" width="44" height="20" border="0" /></a></td>
</tr>
<script type="text/javascript">
editor_generate('MinBoardContents');
</script>
</form>
</table><!-- 게시판 끝 -->
</body>
</html>
댓글목록
등록된 댓글이 없습니다.