/
newsview.asp
71 lines (71 loc) · 2.12 KB
/
newsview.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<% Session.Timeout = 300 %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->
<!--#include file="aspmkrfn.asp"-->
<%
Response.Buffer = True
key = Request.Querystring("key")
If key = "" OR IsNull(key) Then key = Request.Form("key")
If key = "" OR IsNull(key) Then Response.Redirect "newslist.asp"
'get action
a=Request.Form("a")
If a="" OR IsNull(a) Then
a="I" 'display with input box
End If
' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
Select Case a
Case "I": ' Get a record to display
tkey = "" & key & ""
strsql = "SELECT * FROM [news] WHERE [ID]=" & tkey
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn
If rs.EOF Then
Response.Clear
Response.Redirect "newslist.asp"
Else
rs.MoveFirst
End If
' Get the field contents
x_ID = rs("ID")
x_news = rs("news")
rs.Close
Set rs = Nothing
End Select
%>
<!--#include file="header.asp"-->
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
<table align="center" cellpadding="0" cellspacing="0" width="801" bgcolor="white">
<tr>
<td background="images/contactbg.gif">
<p><img src="images/newsbg.gif" width="324" height="32" border="0"></p>
</td>
</tr>
<tr>
<td>
<p>
<form>
<div align="left">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" width="761">
<tr>
<td bgcolor="white" width="280">
<p><img src="images/redcar.gif" width="280" height="306" border="0"></p>
</td>
<td bgcolor="white" width="181" valign="top"><font face="Arial"><span style="font-size:14pt;"><b>The
Latest News:</b></span></font></td>
<td bgcolor="white" width="300" valign="top"><font face="Arial"><span style="font-size:14pt;"><%= replace(x_news & "",chr(10),"<br>") %> </span></font></td>
</tr>
</table>
</div>
</form>
</td>
</tr>
</table>
<!--#include file="footer.asp"-->