18. februar 2004 - 19:51
Der er
14 kommentarer og 2 løsninger
"fncTextChange = Replace(fncTextChange,vbCrLf,"<BR>
if request.form("plusbog") <> "" then Function fncTextChange(strText) strTekst = Trim(strText) fncTextChange = Replace(strTekst,"""","''") fncTextChange = Replace(strTekst,"'","''") fncTextChange = Replace(fncTextChange," "," ") fncTextChange = Replace(fncTextChange,">",">") fncTextChange = Replace(fncTextChange,"<","<") fncTextChange = Replace(fncTextChange,vbCrLf,"<BR>") fncTextChange = Replace(fncTextChange,"å","å") fncTextChange = Replace(fncTextChange,"æ","æ") fncTextChange = Replace(fncTextChange,"ø","ø") fncTextChange = Replace(fncTextChange,"Å","Å") fncTextChange = Replace(fncTextChange,"Æ","Æ") fncTextChange = Replace(fncTextChange,"Ø","Ø") 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) end if set rs = nothing %> <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> og min form... hva skal jeg gøre for at min skift linie vil virke..
Annonceindlæg tema
Offentlig digitalisering
Fra effektivisering til digital suverænitet. Hvordan skaber det offentlige en digital fremtid med AI, sikkerhed og kontrol i centrum?
18. februar 2004 - 20:21
#1
Prøv den her i stedet: <% Function fncTextChange(strText) Dim strTemp strTemp = Trim(strText) strTemp = Replace(strTemp,"""","''") strTemp = Replace(strTemp,"'","''") strTemp = HTMLEncode(strTemp) fncTextChange = strTemp End Function if request.form("plusbog") <> "" then 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 end if %> <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> /Steen
18. februar 2004 - 21:03
#2
ja hva kan jeg sige.. der er en fejl.. den siger ikke hva fejlen er.
18. februar 2004 - 21:06
#3
hmmm... har du en url
18. februar 2004 - 21:24
#5
Prøv at smide koden her fra bog.asp
18. februar 2004 - 21:29
#6
yes gør jeg.. her er de.... <% <% 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 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 dato 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="350" height="21"> <% response.write "Af: <a href='mailto:" & rs.fields("mail") & "'>" &rs.fields("navn") & "</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 "" & rs.fields("hmm") & "" %></td></tr> </table><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>
18. februar 2004 - 21:31
#7
Du havde sådan en her "<%" for meget i linie 1. Det skal se sådan her ud: <% 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 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 dato 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="350" height="21"> <% response.write "Af: <a href='mailto:" & rs.fields("mail") & "'>" &rs.fields("navn") & "</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 "" & rs.fields("hmm") & "" %></td></tr> </table><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>
18. februar 2004 - 21:35
#8
hmm nu er der så fejl.. når man smider noget ind..
18. februar 2004 - 21:36
#9
kigger på det
18. februar 2004 - 21:39
#10
<% 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 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 dato 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="350" height="21"> <% response.write "Af: <a href='mailto:" & rs.fields("mail") & "'>" &rs.fields("navn") & "</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 "" & rs.fields("hmm") & "" %></td></tr> </table><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>
18. februar 2004 - 21:45
#11
altså.. det virker ligesom før.. når jeg laver line skift bare med enter skal det jo også virker.. men nej.. det gør det ikke..
18. februar 2004 - 21:50
#12
En gang mere: <% 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 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 dato 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="350" 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><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>
18. februar 2004 - 21:58
#13
yir.. jeg takker mange gange..
18. februar 2004 - 22:04
#14
eller jeg var for hurtig... den virker altså ikke helt.. den skriver det ikke på siden.. den gemmer det fint i databasen.. men skriver det ikke på siden..
18. februar 2004 - 22:07
#15
har selv fixet den..
18. februar 2004 - 22:08
#16
ok
Kurser inden for grundlæggende programmering