(6)업데이트 하는 소스
update.asp<?XML:NAMESPACE PREFIX = O />
<%@ Language=VBScript %>
<!--#include file="../dbconn.inc" -->
<%
' DB에 저장할 때 (HTML 효과 x)
Function CheckWord(CheckValue)
CheckValue = replace(CheckValue, "&" , "&")
CheckValue = replace(CheckValue, "<", "<")
CheckValue = replace(CheckValue, ">", ">")
CheckValue = replace(CheckValue, "'", "''")
CheckWord = CheckValue
End Function
' DB에 저장할 때 (HTML 효과주기)
Function CheckHTML(CheckValue)
CheckValue = replace(CheckValue, "&" , "&")
CheckValue = replace(CheckValue, "'", "''")
CheckHTML = CheckValue
End Function
pk_id=Request.form("no")
face=Request.form("face")
Email=Request.Form("email")
Homepage=Request.Form("homepage")
if isnull(face) or isEmpty(face) then ' 요 부분은 앞에서 말씀드렸죠.. 첨에 얼굴이미지까지 넣으려구 했었는데..
face=1
end if
tag=Request.Form("tag")
if tag then
content=CheckHTML(Request.Form("content"))
tag=1
else
content=CheckWord(Request.Form("content"))
tag=0
end if
' 실제 업데이트가 이루어지는 부분입니다.
strSQL="update dbo_tbl_guestbook set writedate=date(),"
strSQL=strSQL&"face='"&face&"',"
strSQL=strSQL&"email='"&email&"',"
strSQL=strSQL&"homepage='"&homepage&"',"
strSQL=strSQL&"tag="&tag&","
strSQL=strSQL&"content='"&content&"' where pk_id="&pk_id
set cm=conn.execute(strSQL)
set cm=nothing
Response.Redirect "list.asp"
%>
' 수정부분역시 되게 쉽죠.. 모 소스 분석이라고 할것 도 없네요.. 주석 달만한 곳이 없으니..
[출처] [펌] 제17강 - 방명록 만들기 VI|작성자 정신차렷
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|