replace linieskift med <br>
Hejsa,Jeg har lavet en gæstebog, hvor koden til at tilføje en post er:
<!-- #include file="conn.asp" -->
<link rel="stylesheet" type="text/css" href="style.css">
<%
strCmd = Request.QueryString("cmd")
openConn()
If strCmd = "addnew" Then
strId = Request.Form("id")
strDate = Request.Form("date")
strName = replace(Request.Form("name")&"","'","''")
strHeadline = replace(Request.Form("headline")&"","'","''")
strEmail = replace(Request.Form("email")&"","'","''")
strHomepage = replace(Request.Form("homepage")&"","'","''")
strContext = replace(Request.Form("context")&"","'","''")
strSQL = "INSERT INTO guest ("
strSQL = strSQL & "[Date], "
strSQL = strSQL & "Name, "
strSQL = strSQL & "Headline, "
strSQL = strSQL & "Email, "
strSQL = strSQL & "Homepage, "
strSQL = strSQL & "Context) "
strSQL = strSQL & "values ("
strSQL = strSQL & "'" & Now & "', "
strSQL = strSQL & "'" & strName & "', "
strSQL = strSQL & "'" & strHeadline & "', "
strSQL = strSQL & "'" & strEmail & "', "
strSQL = strSQL & "'" & strHomepage & "', "
strSQL = strSQL & "'" & strContext & "')"
connection.Execute(strSQL)
%>
<h2>Dit indlæg er registreret</h2><br>
<a href="guestview.asp">Gå til Gæstebogen</a>
<%
Else
%>
<h1>Skriv i gæstebogen</h1>
<form method="post" action="guestadd.asp?cmd=addnew">
<table>
<tr>
<td>Navn:</td>
<td align="right"><input type="text" name="name" class="input"></td>
</tr>
<tr>
<td>Overskrift:</td>
<td align="right"><input type="text" name="headline" class="input"></td>
</tr>
<tr>
<td>Email:</td>
<td align="right"><input type="text" name="email" class="input"></td>
</tr>
<tr>
<td>Hjemmeside:</td>
<td align="right">http:// <input type="text" name="homepage" class="input"></td>
</tr>
<tr>
<td colspan="2">Beskrivelse:<br><textarea name="context" cols="39" rows="5" class="input"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Opret" class="knap"></td>
</tr>
</table><br>
<a href="guestview.asp">Gå til Gæstebogen</a>
</form>
<%
End if
closeConn()
%>
__________________________________
Så er mit spørgsmål.. har fundet en kode der efter sigende burde erstatte f.eks. linieskift med <br>, men jeg ved ikke hvordan jeg skal integreer den...
Function Smile(text)
text = server.HTMLEncode(text)
text = Replace(text,vbCrLf,"<br>")
text = Replace(text,"","<b>")
text = Replace(text,"","</b>")
text = Replace(text,"","<i>")
text = Replace(text,"","</i>")
text = Replace(text,"","<u>")
text = Replace(text,"","</u>")
text = Replace(text,":)","<img src=""bluesmile.gif"">")
text = Replace(text,":(","<img src=""ledsensmile.gif"">")
text = Replace(text,"",""" target=""_blank"">")
text = Replace(text,"","</a>")
Response.Write text
End Function
