write.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
' frm_write.asp에서 넘어온 값들을 각 변수에 저장..
Writer=Request.Form("writer")
Email=Request.Form("email")
face=Request.Form("face") ' 아~ 요건 처음에 방명록에 작성자 이미지를 넣을려구 만들었는데 실제 넣지않았거든요~ 여러분이 한번만들어보세요...
if isnull(face) or isEmpty(face) then
face=1
end if
Passwd=Request.Form("passwd")
Homepage=Request.Form("homepage")
ip=Request("REMOTE_ADDR") ' 클아이언트 IP주소를 가져옵니다.
tag=Request.Form("tag")
' HTML 효과 주기와 끄기..
if tag then
content=CheckHTML(Request.Form("content"))
tag=1
else
content=CheckWord(Request.Form("content"))
tag=0
end if
' 실제 디비에 들어가는 구문입니다.
strSQL="insert into dbo_tbl_guestbook(writer,passwd,face,email,homepage,ip,tag,content) values ("
strSQL=strSQL&"'"&writer&"',"
strSQL=strSQL&"'"&passwd&"',"
strSQL=strSQL&"'"&face&"',"
strSQL=strSQL&"'"&email&"',"
strSQL=strSQL&"'"&homepage&"',"
strSQL=strSQL&"'"&ip&"',"
strSQL=strSQL&"'"&tag&"',"
strSQL=strSQL&"'"&content&"')"
set cm=conn.execute(strSQL)
set cm=nothing
Response.Redirect "list.asp?forum_id="&forum_id '무사히 마쳤으면 리스트로 이동(뒤에있는 forum_id는 일단 무시해도 좋습니다. 사실 방명록에서는필요없거든요)
%>
[출처] 정신차렷
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|