Problemer med at hente indhold ind.
Hej eksperter,Jeg har lidt problemer med en af mine sider. I kan se fejlen her:
http://www.team-nopanic.dk/communications_version_1/default.asp?page=1
Håber i kan hjælpe
Koden:
_______________________________
<%
sub communications
ban()
'besked oversigt
if getmode() = "normal" then
if getmode() = "delete" then
restricted()
SQL = "DELETE FROM communications WHERE id = " & request.querystring("id")
set RS = conn.execute(SQL)
response.redirect("??page=1")
end if
if getmode() = "ban" then
restricted()
SQL = "INSERT INTO ban WHERE ip = " & request.querystring("ip")
set RS = conn.execute(SQL)
response.redirect("??page=1")
end if
response.write("<table width='630' align='center' cellpadding='3' cellspacing='0'>")
response.write("<tr>")
response.write("<td height='23' align='center' valign='top' class='textheader'><a href='?page=1?mode=addmessage'>Tilføj besked</a></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td>")
response.write("</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td align='center' valign='top' class='textnormal'>")
SQL = "SELECT COUNT(*) as count FROM communications "
set RS = conn.execute(SQL)
response.write("Beskeder: " &"<b>"& RS("count") &" <br></b>")
SQL = "SELECT id, author, body, addeddate, ip, website, email, topic FROM communications "
set RS = conn.execute(SQL)
'opbygning af pagingsystem
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 3
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
Do While Not rs.EOF And intRecCount > 0
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
Response.Write "Side: "
For intNum = 1 To intPageCount
If intPage = intNum Then
Response.Write " [" & "<b>" & intNum &"</b>" & "] "
Else
Response.Write "<a href=?page=1?page=" & intNum & ">" & intNum & "</a> "
End If
Next
response.write("<br>")
response.write("<br>")
response.write("<tr>")
response.write("<td colspan='4' height='1' background='gfx/dot_horizontal.gif'></td>")
response.write("</tr>")
response.write("</td>")
response.write("</tr>")
response.write("</table>")
response.write("<br>")
'Starter selve tabellen hvori beskeden ligger!
response.write("<table width='630' align='center' cellpadding='0' cellspacing='10' class='table_bluelight'>")
response.write("<tr>")
response.write("<td><table width='100%' border='0' cellpadding='0' cellspacing='0'>")
response.write("<tr>")
response.write("<td width='63%' height='18'>")
SQL = "SELECT id, author, body, addeddate, ip, website, email, topic FROM communications ORDER BY addeddate DESC; "
set RS = conn.execute(SQL)
response.write(" <font color='#' class='textheader'>" & RS("topic") & "")
response.write("</td>")
response.write("<td width='37%' align='right' valign='top'>")
response.write(" <font color='#999999' class='textfade'>" & formatdatetime(RS("addeddate"),1) & " kl. " & formatdatetime(RS("addeddate"),4) & "</a></font> ")
response.write("</td>")
response.write("</tr>")
response.write("</table>")
response.write("</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td><table width='100%' border='0' cellpadding='0' cellspacing='5' class='textnormal'>")
response.write("<tr>")
response.write("<td>")
response.write("" & RS("body") & "")
response.write("</td>")
response.write("</tr>")
response.write("</table>")
response.write("</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td height='18'><table width='100%' border='0' cellpadding='0' cellspacing='0' class='textfade'>")
response.write("<tr>")
response.write("<td valign='top'>")
response.write("// " & RS("author") & "")
response.write("</td>")
response.write("<td align='right' valign='bottom'>")
if session("login") = "true" then
response.write("<font color='CCCCCC'>IP-adresse: "& RS("ip") &"</font>")
response.write(" ")
response.write(" ")
response.write("<a href='?page=1&mode=delete&id=" & RS("id") & "'>Slet besked</a>")
response.write(" ")
response.write("<font color='#111111'>|<fon/t>")
response.write(" ")
response.write("<a href='?page=1&mode=ban&ip=" & RS("ip") & "'>Ban</a>")
response.write(" ")
response.write(" ")
end if
if not RS("website") = "" then
response.write("")
response.write("<a href=' " & RS("website") & " ' >")
response.write("<img src='gfx/website.gif' alt='Besøg "& RS("author") & "s website'"" width='16' height='16' border='0'></a>")
response.write(" ")
response.write(" ")
else
end if
if not RS("email") = "" then
response.write("")
response.write("<a href='mailto:" & RS("email") & " ' >")
response.write("<img src='gfx/mail.gif' alt='Skriv en e-mail til "& RS("author") &"'"" width='16' height='16' border='0'></a>")
else
response.write("")
end if
response.write("</td>")
response.write("</tr>")
response.write("</table>")
response.write("</td>")
response.write("</tr>")
response.write("</table>")
rs.movenext
response.write("<br>")
response.write("<table width='630' align='center' cellpadding='3' cellspacing='0' class='textnormal'>")
response.write("<tr>")
response.write("<td align='center' valign='top' class='textnormal'>")
response.write("<tr>")
response.write("<td colspan='4' height='1' background='gfx/dot_horizontal.gif'></td>")
response.write("</tr>")
response.write("</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td align='center' valign='top' class='textnormal'>")
SQL = "SELECT COUNT(*) as count FROM communications "
set RS = conn.execute(SQL)
response.write("<br>")
response.write("Beskeder: " &"<b>"& RS("count") &" <br></b>")
SQL = "SELECT id, author, body, addeddate, ip, website, email, topic FROM communications "
set RS = conn.execute(SQL)
'opbygning af pagingsystem
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 3
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
Do While Not rs.EOF And intRecCount > 0
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
Response.Write "Side: "
For intNum = 1 To intPageCount
If intPage = intNum Then
Response.Write " [" & "<b>" & intNum &"</b>" & "] "
Else
Response.Write "<a href=?page=1?page=" & intNum & ">" & intNum & "</a> "
End If
Next
response.write("<br>")
response.write("<br>")
end if
end if
response.write("</td>")
response.write("</tr>")
response.write("</table>")
response.write("<br>")
'Tilføj besked
if getmode() = "addmessage" then
author = request.cookies("nick")
email = request.cookies("email")
if request.form("mode") = "insert" then
topic = replace(Trim(request.form("topic")),"'","''")
body = replace(Trim(request.form("body")),"'","''")
bodyStr = replace(body,vbcrlf,"<br>")
author = Trim(request.form("nick"))
email = Trim(request.form("email"))
website = Trim(request.form("website"))
ierr = 0
if author = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive et navn</li>"
end if
if topic = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive en overskrift</li>"
end if
if body = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive en besked</li>"
end if
'Udskriver fejlene
response.write("<table width='630' align='center' cellpadding='5' cellspacing='5' class='texterror'>")
response.write("<td colspan='2'> " & "Følgende fejl opstod:" & errormsg & "</font><br></td>")
response.write("</table>")
if ierr = 0 then
SQL = "insert into (author, email, website, topic, body, ip) values('"
SQL = SQL & author & "','"
SQL = SQL & email & "','"
SQL = SQL & website & "','"
SQL = SQL & topic & "','"
SQL = SQL & bodyStr & "','"
SQL = SQL & Request.ServerVariables("REMOTE_ADDR") & "')"
set RSinsert = conn.Execute(SQL)
if request.form("remember") = "true" then
Response.cookies("communication")("nick") = author
Response.cookies("communication")("email") = email
Response.Cookies("communication").Expires = Date+365
end if
response.redirect("?page=1")
end if
end if
response.write("<form name='form1' method='post' action='?page=1?mode=addmessage'><input type='hidden' name='mode' value='insert'>")
response.write("<table width='630' align='center' cellpadding='3' cellspacing='0' class='textnormal'>")
response.write("<tr>")
response.write("</tr>")
response.write("<tr>")
response.write("<td width='153'>Navn: * </td>")
response.write("<td width='455'><input name='nick' type='text' id='nick' value='" & author & "' class='textfields' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td>E-mail: *</td>")
response.write("<td width='455'><input name='email' type='text' class='textfields' id='email' value='" & email & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write(" <td>Website:</td>")
response.write("<td height='24' width='455' valign='top'><input name='website' type='text' class='textfields' id='website' value='" & website & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write(" <td height='24'>Overskift: *</td>")
response.write("<td valign='bottom'><input name='topic' type='text' class='textfields' id='topic' value='" & topic & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td valign='top'>Besked: *</td>")
response.write("<td width='455' valign='top' class='textsmall'>")
response.write("<textarea name='body' cols='86' class='textareas' onselect='storeCaret(this);' onchange='storeCaret(this);countLetters(this);' onclick='storeCaret(this);' onkeydown='storeCaret(this);countLetters(this);' onkeyup='storeCaret(this);countLetters(this);'>"& body &"</textarea>")
response.write("<br>")
response.write("Din besked må maksimalt være på 700 tegn - du har <span id='lettercount'>700</span> tegn tilbage.")
response.write("<br>")
response.write("<td width='2'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td height='36' valign='top'>Husk mine informationer:<br>")
response.write("<font color ='cccccc'>(Ved brug af Cookies)</font></td>")
response.write("<td height='40' valign='top'><input name='remember' type='checkbox' class='checkbox' id='remember' value='checkbox'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td></td>")
response.write("<td><input name='Submit' type='submit' class='submitfield' value='Opret beskeden'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td height='40' valign='bottom'> »<a href='?page=1'> Tilbage til </a></td>")
response.write("<td></td>")
response.write("</tr>")
response.write("</table>")
response.write("</form>")
end sub
%>