I have the following script from a forum that collected data from a form and inserted in the. Mdb
These are displayed through a file that reads the database.
At this time the display is text, URLs are not active.
The script is not so do not really know what to do.
I need that URLs appear as a link at this time does not happen.
Can you help me?
<%
IdMensaje = Request.QueryString("IdMensaje")
busca = Trim(Request.QueryString("busca"))
Set oConn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSet")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&Server.MapPath(".private//usuarios.mdb")
sql = "SELECT * FROM discusion WHERE IdMensaje="&IdMensaje&""
Rs.Open sql, oConn, 1, 1
mensaje = RS("mensaje")
%>
<img src="anadir.gif" width="16" height="16"> <A HREF="contestar.asp?idmensaje=<%=IdMensaje%>"><B>Contestar
este mensaje</B></A><BR>
<BR>
<%'=== Muestro el mensaje padre. La pregunta inicial ======
Response.Write "<B>Nombre: </B>"&RS("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS("Title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR><P><I>"& AcomodarTXT(mensaje)&"</I></P>"
Response.Write "<HR WIDTH=""80%"">"
'===== Fin pregunta inicial ===== Set RS2 = Server.CreateObject ("ADODB.RecordSet")
sql2 = "SELECT * FROM discusion WHERE IdCabeza="&IdMensaje &" ORDER BY fecha"
RS2.Open sql2, oConn, 1, 1
'===== Respuestas a la pregunta inicial
Do While not RS2.EOF
mensaje2 = RS2("mensaje")
Response.Write "<BR><B>Nombre: </B>"&RS2("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS2("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS2("title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing

Function AcomodarTXT(txt)
txt = Replace (txt, "<", "&lt;")
txt = Replace (txt, ">", "&gt;")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function
%>

Recommended Answers

All 2 Replies

Dear,
which links do you mean? I had a quick look at the script, seems to be fine. Or maybe I have not understood your problem.

Ali

I need to change the funcion AcomodarTXT(mensaje2) >"& AcomodarTXT(mensaje)&"
This function dont'convert url on active links, it is plan text
But I don't know how I change it?

Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing

Function AcomodarTXT(txt)
txt = Replace (txt, "<", "&lt;")
txt = Replace (txt, ">", "&gt;")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.