Ja det er rigtigt hvis jeg havde en gæstebog med en admin side, men det har jeg ikke. Jeg har en gæstebog som jeg har downloadet, men der skal jeg først til at oprette en admin side koden kommer her.
default.asp
<html>
<head>
<title>Gæstebog</title>
<style>
<!--
A:link {text-decoration: none; color: #808080;}
A:visited {text-decoration: none; color: #808080;}
A:active {text-decoration: none; color: #000000;}
A:hover {text-decoration: none; color: #000000;}
-->
BODY {SCROLLBAR-FACE-COLOR: FFFFFF; SCROLLBAR-HIGHLIGHT-COLOR: #808080; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #5b6470; SCROLLBAR-BASE-COLOR: #000000}
</style>
</head>
<body bgcolor="#FF0000">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="1">
<tr>
<td class="boxText" width="100%" height="1" colspan="2">
<p align="center"><b><font face="Verdana" size="2">Danskfront</font></b>
</td>
</tr>
<tr>
<td class="boxText" width="50%" height="1"><font face="Verdana" size="1">Der
er i alt <%
Set Rs = Server.CreateObject("ADODB.Connection")
DBPath = "DBQ=" & server.mappath("database.mdb")
Rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & DBPath
Sql = "Select count(*) as Found from kommentarer"
Set Record = Rs.Execute(Sql)
Ialt = Record("found")
%>
<b><% =ialt %></b> indlæg.</font></td>
<td class="boxText" width="10%" height="1">
<p align="left"><font face="Verdana" size="1"><b><img border="0" src="images/index.gif" width="16" height="16">
Læs i gæstebogen<br>
<img border="0" src="images/svar.gif" width="16" height="16"> </b><a href="opret.asp" target="_self">Skriv i
gæstebogen</a></font></td>
</tr>
<tr>
<td class="boxText" width="100%" height="1" colspan="2">
<%
Set connect = Server.CreateObject("ADODB.Connection")
Connect.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
sql = "select * from kommentarer ORDER BY id desc"
Set rs = Server.CreateObject("ADODB.Recordset")
set rs = Connect.execute(SQL)
count = 25
While not rs.eof and count > 0
count = count -1
%>
<table align="center" cellSpacing="0" cellPadding="0" width="460" border="0" height="1">
<tr>
<td class="boxText" width="50%" height="1"><font face="Verdana" size="1">Skrevet
af: <% if rs ("HP") <> "" then %><a href="
http://<%= rs("HP")%>" target="_blank"><%= rs("navn")%></a><% else %><%= rs("navn")%><% end if %></font></td>
<td class="boxText" width="50%" height="1">
<p align="left"><font face="Verdana" size="1">Dato:<%= rs("dato")%></font></p>
</td>
</tr>
<tr>
<td class="boxText" width="50%" height="1"><font size="1" face="Verdana">Stjerner:<img border="0" src="images/<%= rs("star")%>.gif"></font></td>
<td class="boxText" width="50%" height="1"><font size="1" face="Verdana">E-mail:<% if rs ("email") <> "" then %><a href="mailto:<%= rs("email")%>"><%= rs("email")%></a><% else %>Ikke oplyst<% end if %></font></td>
</tr>
<tr>
<td class="boxText" width="100%" height="1" colspan="2"><font size="1" face="Verdana"><%= rs("kommentar")%></font></td>
</tr>
<tr>
<td class="boxText" width="100%" height="1" colspan="2"><font size="1" face="Verdana"> </font></td>
</tr>
</table>
<%
rs.MoveNext
Wend
%>
</td>
</tr>
<tr>
<td class="boxText" width="100%" height="1" colspan="2">
<p align="center">
</td>
</tr>
</table>
</body>
</html>
opret.asp
<%
mode = Request("mode")
Response.Buffer = True
%>
<html>
<head>
<style>
<!--
A:link {text-decoration: none; color: #808080;}
A:visited {text-decoration: none; color: #808080;}
A:active {text-decoration: none; color: #000000;}
A:hover {text-decoration: none; color: #000000;}
-->
BODY {SCROLLBAR-FACE-COLOR: FFFFFF; SCROLLBAR-HIGHLIGHT-COLOR: #808080; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #5b6470; SCROLLBAR-BASE-COLOR: #000000}
</style>
<title>Tilføj til gæstebogen</title>
</head>
<body bgcolor="#FF0000">
<% if mode = "" then %>
<form method=post action=opret.asp?mode=gem>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="1">
<tr>
<td class="boxText" width="100%" height="1" colspan="2">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="1">
<tr>
<td class="boxText" width="100%" height="1" colspan="2">
<p align="center"><b><font face="Verdana" size="2">Danskfront</font></b>
</td>
</tr>
<tr>
<td class="boxText" width="50%" height="1"><font face="Verdana" size="1">Der
er i alt <%
Set Rs = Server.CreateObject("ADODB.Connection")
DBPath = "DBQ=" & server.mappath("database.mdb")
Rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & DBPath
Sql = "Select count(*) as Found from kommentarer"
Set Record = Rs.Execute(Sql)
Ialt = Record("found")
%>
<b><% =ialt %></b> indlæg.</font></td>
<td class="boxText" width="10%" height="1">
<p align="left"><font face="Verdana" size="1"><b><img border="0" src="images/index.gif" width="16" height="16">
</b><a href="default.asp">Læs i gæstebogen</a><b><br>
<img border="0" src="images/svar.gif" width="16" height="16">
Skriv i
gæstebogen </b></font></td>
</tr>
</table>
<p align="left"><b><font face="Verdana" size="1">Tilføj til gæstebogen:</font></b></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"><font face="Verdana" size="1">Navn:<font color="#FF0000">*</font></font></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"> <input type=text name=navn style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"><font face="Verdana" size="1">Stjerner:<font color="#FF0000">*</font></font></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"><select onchange="person.src='images/'+this.value+'.gif'" name="star" class="bottom" size="1" style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF">
<option value="0" selected>(Vælg)</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select><IMG id=person src="images/0.gif"></font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"></td>
<td class="boxText" width="93%" height="1"></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"><font face="Verdana" size="1">E-mail:</font></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"> <input type=text name=email style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF">
</font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"><font face="Verdana" size="1">Hjemmeside:</font></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"><input type=text name=HP size="20" style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF">
Skriv ikke "
http://"</font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1">
<p align="left"><font face="Verdana" size="1">Kommentar:<font color="#FF0000">*</font></font></p>
</td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"><textarea name=kommentar col=10 rows=4 cols="59" style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1">
<input type=submit value=Tilføj style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF">
</font></td>
</tr>
<tr>
<td class="boxText" width="7%" height="1"></td>
<td class="boxText" width="93%" height="1"><font face="Verdana" size="1"><font color="#FF0000">*</font> betyder at feltet skal
udfyldes</font>
</td>
</tr>
</table>
<p align="center"><font face="Verdana" size="1"><br>
<font face="Verdana" color=red size=1><%=Request.Querystring("error")%></font>
</font>
</form>
<% end if %>
<% if mode = "gem" then
'//Tjecker om brugernavn kodeord og email er udfyldt!
if Request.form("navn") = "" then Response.Redirect("opret.asp?error=Udfyld brugernavn") end if
if Request.form("star") = "0" then Response.Redirect("opret.asp?error=Du skal give mindst en stjerne") end if
if Request.form("kommentar") = "0" then Response.Redirect("opret.asp?error=Du skal skrive en kommentar") end if
'//Connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.mdb") & ";UID=admin;PWD=;"
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "Select * From kommentarer where navn = '" & Request.form("navn") & "'"
rs.Open strSQL, Conn, 1, 3
'//Tilføjer brugeren til databasen!
rs.addnew
rs("navn") = Request.form("navn")
rs("star") = Request.form("star")
rs("email") = Request.form("email")
rs("HP") = Request.form("HP")
rs("kommentar") = Request.form("kommentar")
rs.update
Response.Write("<font face='Verdana' color=red size=1>Dit indlæg er tilføjet. <a href='default.asp'>Tryk her</a> for at komme til index</font>")
rs.Close
Set rs = Nothing
Conn.Close
set Conn = Nothing
end if %>
</body>
</html>
Hvis du kan fortælle mig hvordan jeg gør det her får du dine point.