% server.Execute "/NoHACK1.asp" dim NewsID, strSQL, rs, rs1, Errh, NewsType, Y, M, NewsTypePic, TitlePic, T1, Y1, M1, viewContentPW, NewsShow NewsID = ReqNum(request("ID")) viewContentPW = request("ps") '---- 取單筆公告 strSQL = "SELECT NewsShow, NewsTitle, DATE_FORMAT(AddTime, '%Y.%m.%d') AS NewsAddTime, NewsData, NewsType FROM TOP_Notice WHERE NewsID=" & NewsID set rs = GetRecordset(strSQL) If rs.BOF and rs.EOF Then rs.close Response.Redirect "/Main.asp" Response.End Else NewsShow = trim(rs("NewsShow").value) if (NewsShow<>"Y" and viewContentPW<>"3345678") then rs.close Response.Redirect "/Main.asp" Response.End end if NewsType = rs("NewsType").value Y = Left(rs("NewsAddTime").value,4) M = Mid(rs("NewsAddTime").value,6,2) select case NewsType case "A" TitlePic = "new2.gif" NewsTypePic = "h.gif" case "B" TitlePic = "new3.gif" NewsTypePic = "i.gif" case "C" TitlePic = "new4.gif" NewsTypePic = "a.gif" case "D" TitlePic = "new6.gif" NewsTypePic = "b.gif" case "E" TitlePic = "new5.gif" NewsTypePic = "s.gif" case "S" TitlePic = "new5.gif" NewsTypePic = "s.gif" case else TitlePic = "new1.gif" NewsTypePic = "i.gif" end select End If '---- 增加點閱數 strSQL = "UPDATE TOP_Notice SET N_Count = N_Count + 1 WHERE NewsID = " & NewsID Errh = DoCommand(strSQL) %>
<% rs.close : set rs = nothing %>