den hvis kun nogle tenge.. ikke dem alle..
<% if request.querystring("mode") = "del" thenSet Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("admin/louisedenmegasøde.mdb")
Conn.Open DSN
sql = "delete from bog where id = " & request.querystring("id")
set rs = Conn.execute(sql)
set rs = nothing
end if
%>
<%
if request.form("plusbog") <> "" then
Function fncTextChange(strText)
Dim strTemp
strTemp = Trim(strText)
strTemp = Replace(strTemp,"""","''")
strTemp = Replace(strTemp,"'","''")
'strTemp = HTMLEncode(strTemp)
fncTextChange = strTemp
End Function
indhold = fncTextChange(request.form("hmm"))
set MyConn = Server.CreateObject("ADODB.Connection")
conn = "DRIVER={Microsoft Access Driver (*.mdb)}; "
conn = conn & "DBQ=" & server.mappath("admin/louisedenmegasøde.mdb")
MyConn.open conn
sql = "Insert into bog(navn, hmm, mail, dato) VALUES('"&request.form("navn")&"','"&request.form("hmm")&"','"&request.form("mail")&"','"&now()&"')"
set rs = MyConn.execute(sql)
set rs = nothing
response.Redirect("bog.asp")
end if
%>
<html>
<head>
<style type="text/css">
a:link {
color: black;
text-decoration:none;
}
a:visited {
color: Black;
text-decoration:none;
}
a:active {
text-decoration:none;
}
a:hover {
color: black;
text-decoration:none;
}
</style>
<title>Bog</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#C10409" text="#000000" link="#000000">
<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("admin/louisedenmegasøde.mdb")
Conn.Open DSN
sql = "select * from bog order by id desc"
set rs = conn.execute(sql)
%>
<%
i = 0
do while not rs.EOF
%>
</p><table border="1" bordercolor="#C10409">
<tr bordercolor="#000000">
<td width="500" height="21">
<table border="1" bordercolor="#c10409">
<tr>
<td width="325" height="21">
<% response.write "Af: <a href='mailto:" & rs.fields("mail") & "'>" & Replace(rs.fields("Navn"),VbCrlf,"<br>") & "</a>" %>
</td>
<td align="left"><% response.Write "" & rs.fields("dato") & "" %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="500" bordercolor="#000000" colspan="2"><% response.Write "" & Replace(rs.fields("hmm"),VbCrlf,"<br>") & "" %></td>
</tr>
</table>
<%
if not session("login") = "" then
response.write ("<a href='bog.asp?mode=del&id=" & rs.fields("id") & "'>Slet</a>")
end if
%>
<br><br>
<%
rs.movenext
i = i + 1
loop
rs.close
set rs = nothing
%>
Der er ialt skrevet <%=i%> indlæg
<table width="100%" border="1" bordercolor="#000000">
<tr bordercolor="C10409">
<TD COLSPAN="2" HEIGHT="1" BGCOLOR="#C10409" width="100%"></TD>
</tr>
</table>
<form METHOD="post" ACTION="bog.asp">
Fra:<br>
<input type="text" name="navn"><br>
Din mail:<br>
<input type="text" name="mail"><br>
Din Gæstebogs indlæg her:<br>
<textarea name="hmm" cols="50" rows="10" ></textarea><br>
<input type="submit" name="plusbog" value="Skriv i gæstebog">
</form>
</body>
</html>
