FreeBoard 홈 > Community > FreeBoard

 
오늘은 셤 2과목 보는데.. 흑흑..
흑흑.. 오늘은 셤 2과목입니다.

공부 하나도 못하고 있어요..

이리저리 불려다니느라... 게다가 이것까지...

하지만.. 열심히 답변해 드리죠.. ^^

<% if mode="ok" then %>
<%
search_title=request("search_title")
search_content=request("search_content")
search_name=request("search_name")
search_list=request("search")
%>

------------------------------------------------------
위의 내용은 검색에 관한거군요..

이전페이지에서 request 로 넘겨받는거에요..

제목,내용,이름 선택값..과 검색단어....

넘겨받는 것뿐입니다.

------------------------------------------------------


function reply()
{
document.reply.submit();
}

//-->
</script>

이건 답변을 달고자 할때 쓰이는 스크립트..
<%
id = request("id")

Set db = Server.CreateObject("ADODB.Connection")
db.Open dbname

db 파일에 연결하는 부분입니다.

UpdateSQL = "Update " & session("table") & " Set visit
= visit+1 where id = " & id

글 읽기를 할때 조회수를 올려주기 위한 겁니다.
글의 번호에만 조회수 1을 올려라 이거죠..


db.Execute UpdateSQL

이건.. 위의 조회수 올리는 문을 실행하라..

SQL = "SELECT
id,name,email,url,title,content,pin,writeday,tag,num,visit,re,res
ame,reid from " & session("table")
SQL = SQL & " where id = " & id

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open SQL,db
%>
이건 글번호가 같은 걸 db파일에서 요청한..
id,name,email.. 등등 값을 가져오라...
--------------------------------------------------------------

<% if Rs.BOF or Rs.EOF then %>

<p>저장된 정보가 없어여.. </p>

<%
else

id = rs("id")
name = rs("name")
email = rs("email")
url = CheckWord(rs("url"))
title = rs("title")
content = rs("content")
pin = CheckWord(rs("pin"))
writeday = rs("writeday")
visit = rs("visit")
tag = rs("tag")
re = rs("re")
reid = rs("reid")
resame = rs("resame")

여기까지는 db파일에서 가져온 값들을 각 변수에 저장하는거에요.

if tag = "ok" then
title = CheckWord(title)
content = CheckWord(content)
else
title = replace(title,"&quot;","'")
content = replace(content,"&quot;","'")
end if

태그사용시 와 사용하지 않을때 html 적용에 관한거..

if search_title = 1 then
title = replace(title,search_list,"<b><font
color=#ff7b00>"&search_list&"</font></b>")
end if

if search_content = 1 then
content = replace(content,search_list,"<b><font
color=#ff7b00>"&search_list&"</font></b>")
end if

if search_name = 1 then
name = replace(name,search_list,"<b><font
color=#ff7b00>"&search_list&"</font></b>")
end if

위의 3개의 if 문은 검색한후 글읽기시...
검색단어를 구별해주기위해 색을 넣는거죠..

%>

--------------------------------------------------------

<%
rs.Close

SQL = "SELECT (id) FROM " & session("table")
SQL = SQL & " where reid = 0 and re > " & re

set rs = db.Execute(SQL)
if not (rs.BOF or rs.EOF) then
content_back = rs(0)
end if
rs.Close

SQL = "SELECT Max(id) FROM " & session("table")
SQL = SQL & " where reid = 0 and re < " & re

set rs = db.Execute(SQL)
if not (rs.BOF or rs.EOF) then
content_next = rs(0)
end if
rs.Close

SQL2 = "SELECT * FROM " & session("table")
SQL2 = SQL2 & " where re = " & re

if content_back <> "" then
SQL2 = SQL2 & " or id =" & content_back
end if

if content_next <> "" then
SQL2 = SQL2 & " or id =" & content_next
end if

SQL2 = SQL2 & " order by re desc,reid asc"

rs.Open SQL2,db

%>

------------------------------------------------------------
이건.. 그 현재의 글의 답변과 이전글과 다음글을 나타내기 위한

부분입니다.
<%
Do until Rs.EOF

name = rs("name")
writeday = left(rs("writeday"),8)
title = rs("title")
tag = rs("tag")

if left(now,2) = "20" then
nowday = mid(now,3)
else
nowday = now
end if


if tag = "ok" then
title = CheckWord(title)
If Len(title) > 30 Then
title = Mid(title,1,31) & ".."
End If
else
title = replace(title,"&quot;","'")
If Len(title) > 20 Then
title = Mid(title,1,21) & ".."
End If
end if

If Len(name) > 5 Then
name = Mid(name,1,6) & ".."
End If

If Len(title) > 24 Then
title = Mid(title,1,25) & "..."
End If

%>

----------------------------------------------------------
이건 위에 설명한것과 비슷하니.. 대충 아시겠죠??

이상입니다... ^^

곧 셤 시간이 다가와서.. 셤공부를 조금이라도 하기위해..

급하게 적었습니다... 헉헉~~~

이렇게 한꺼번에 하면.. 제가 설명을 붙이기 그러니..

담에 또 원하시는거 있으시면.. 조금씩.. 질문하세요..

그럼 거기에 관해 지금 보다는 좀더 자세히 적을 수 있을테니깐요..

그럼..항상 즐거운 시간 보내세요.. ^^

2001년 12월 06일 (13:27)
윗글 | 아랫글

3023, 137 / 152
no title name date visit
303 시댕.. 힘들어 죽겠다..
2001-12-11 822
302 절대경로라고 하는게 맞나요? 하하..
2001-12-11 824
301 이건... 이렇게 해보세요..
2001-12-11 785
299 자료실용 게시판...
좋은날
2001-12-10 1206
298 이노
zzoi
2001-12-10 878
297 절대경로르 어떻게 얻죠?
맹이
2001-12-09 883
291 이부분만 갈켜줘요
알고싶어요
2001-12-09 823
296 감사합니다...
안미라
2001-12-08 1144
295 today에 관한 의문점..
김영길
2001-12-08 911
294 이노(inno)의 지금 처지~~~ -.-;
2001-12-08 819
293 이부분은 저도 애매한 부분입니다.
2001-12-08 801
292 답변입니다. ^^
2001-12-08 1149
290 바쁜신데...부탁하나만 할께여..
안미라
2001-12-08 1198
289 안녕하세요
무극인
2001-12-08 815
288 감사 합니다..정말루...
알고싶어요
2001-12-07 754
284 이소스 갈켜줘요...
알고싶어요
2001-12-07 886
287 드뎌 모든 셤이 끝났습니다.
2001-12-06 1138
286 바쁜데 미안함다.
신의호(11)
2001-12-06 785
-- 오늘은 셤 2과목 보는데.. 흑흑..
2001-12-06 899
279 잘 봤습니다만.....넘 비슷하당;
pring
2001-12-06 906
「첫페이지」「이전10페이지」 132 .  133 .  134 .  135 .  136 .  137 .  138 .  139 .  140 .  141 「다음10페이지」 「끝페이지」


I D
P W
회원가입
Community
    FreeBoard
    Notice

Copyright © 2001-2024 All rights Reserved.     Powered by INNO WB 0.6 Beta (.Net)