Heej alle sammen.
Jeg kan ikk' selv se fejlen i det jeg gerne vil lave.
men se :
http://frip.dk/seb1992/BygSam/Lald.asp
Og bare prøv og skriv noget, men så siger den af der er en fejl i
linie 204.
Men jeg syntes af det ser rigtigt ud ...
Filen's indhold :
<body background="bg.gif">
<style type="text/css">
body {
border-bottom:scrollbar-3dlight-color : #;
scrollbar-arrow-color : #;
scrollbar-base-color : #;
scrollbar-darkshadow-color : #;
scrollbar-face-color : #;
scrollbar-highlight-color : Black;
scrollbar-shadow-color : #;
scrollbar-track-color : #
}
</style>
<%
' Guestbook script by Brith-Marie Warn
'
http://www.web-graphics.net
' portalen@web-graphics.net
' copyright (c) 2002 Brith-Marie Warn
' Smilies from MSN messenger
'
' Installation: Just upload to your server and run Lald.asp
' Run delgast.asp to remove messages. User and password = admin -
change in table login
%>
<script language="Javascript">
<!-- hide
function insertsmily(smilyface){
document.write.meddelande.value+=smilyface;
}
// -->
</script>
<%
Response.buffer=True
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &
Server.MapPath("db.mdb")&";"
select case request("action")
case ""
%>
<link href="style.css" rel="stylesheet" type="text/css">
<form name="write" method="post"
action="Lald.asp?action=addpost">
<table width="80%" border="0" align="center" cellpadding="0"
cellspacing="3" ="ruta">
<tr> Firma :
<td width="15%"><font size="1"><b>Navn</b></font></td>
<td> <input name="Navn" type="text" class="inmatning">
</td>
</tr>
<tr>
<td width="15%"><font size="1"><b>Adresse :</b></font></td>
<td> <input name="Adresse" type="text" class="inmatning">
</tr>
<tr>
<td width="15%"><font size="1"><b>By og post
nr.</b></font></td>
<td> <input name="By" type="text" class="inmatning">
</tr>
<tr>
<td width="15%"><font size="1"><b>Land</b></font></td>
<td> <input name="Land" type="text" class="inmatning">
</tr>
<tr>
<td width="15%"><font size="1"><b>Tlf. nr.</b></font></td>
<td> <input name="Tlf" type="text" class="inmatning">
</tr>
<tr>
<td width="15%"><font size="1"><b>E-mail :</b></font></td>
<td> <input name="Email" type="text" class="inmatning">
</tr>
<tr>
<td width="15%"><font size="1"><b>Hjemmeside
:</b></font></td>
<td> <input name="url" type="text" class="inmatning">
</tr>
<tr>
<td valign="top"><font size="1"><b>Information</b></font>
<table width="100%" border="0" cellspacing="0"
cellpadding="4">
</table>
<td width="63%"> <p>
<textarea name="meddelande" cols="16" rows="3"
class="inmatning"></textarea>
</p>
<p>
<input name="Submit" type="submit" class="input"
value="Skriv">
</p></td>
</tr>
</table>
</form>
<%
Set rsvisa = Server.CreateObject("ADODB.Recordset")
SQL = "select * from gastbok order by datum desc"
rsvisa.Open SQL, Connect, 3,3
'Number of messages to show per page
rsvisa.pagesize = 1
page = Request.QueryString("page")
If page = "" then page = 1
if rsvisa.EOF then
Response.write "<div align=center>Ingen har skrevet </center>"
Else
rsvisa.AbsolutePage = page
totalPages = rsvisa.PageCount
Do until rsvisa.EOF or fldcounter = rsvisa.pagesize
fldcounter = fldcounter + 1
%>
<table width="80%" border="0" align="center" cellpadding="0"
cellspacing="0" ="inlagg">
<tr>
<td><strong>
<% = rsvisa("Navn") %><br>
<% = rsvisa("Adresse") %><br>
<% = rsvisa("By") %><br>
<% = rsvisa("Land") %><br>
<% = rsvisa("Tlf") %><br>
<a href="mailto:<% = rsvisa("email") %>"><br>
<a href="<% = rsvisa("url") %>" target="_blank">
<% = rsvisa("url") %>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><% = rsvisa("meddelande") %></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
</a> </strong></font> </td>
</tr>
</table>
<br>
<%
rsvisa.movenext
loop
End If%>
<table width="80%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td> <font size="1">
<%
i = 0
For i = 1 to rsvisa.PageCount
If (Int(i)) = (Int(page)) then
Response.write "<b>"& i &"</b> "
Else
Response.write "<a href=Lald.asp?page="& i &">"& i &"</a> "
End If
Next
If page = 1 then
Response.write "«"
Response.write " "
Response.write "<a href=Lald.asp?page=" & page + 1 &" >»</a>"
ElseIf (Int(totalPages)) = (Int(page)) then
Response.write "<a href=Lald.asp?page=" & page - 1 &" >«</a>"
Response.write " "
Response.write "»"
Else
Response.write "<a href=Lald.asp?page=" & page - 1 &" >«</a>"
Response.write " "
Response.write "<a href=Lald.asp?page=" & page + 1 &" >»</a>"
End If
%>
</font></td>
</tr>
</table>
<%
rsvisa.close
set rsvisa=nothing
case "addpost"
if request.form("Navn") > "" and request.form("meddelande") > ""
then
strNavn=CStr(request.form("Navn"))
strAdresse=CStr(request.form("Adresse"))
strBy=CStr(request.form("By"))
strLand=CStr(request.form("Land"))
strTlf=CStr(request.form("Tlf"))
strEmail=CStr(request.form("Email"))
strurl=CStr(request.form("url"))
strMeddelande=Cstr(request.form("meddelande"))
' below you can add more words to be banned
strMeddelande=Replace(strMeddelande,"fuck","***")
strMeddelande=Replace(strMeddelande,chr(10),"<br>")
strRubrik=Replace(strRubrik,"'","''")
connect.execute ("insert into gastbok (Navn, Adresse, By, Land,
Tlf, Email, url, meddelande) values('" & strNavn & "','" &
strAdresse & "','" & strBy & "','" & strLand & "','" & strTlf &
"','" & strEmail & "','" & strurl & "','" & strMeddelande & "')")
response.redirect("Lald.asp")
else
response.write "you must write a name and a message to post"
end if
end select
%>
, Men jeg forstår det bare ikke : /
Hjælp mig.
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials