944,058 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1174
  • ASP RSS
Nov 7th, 2009
0

Help with script asp

Expand Post »
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
%>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Jhon100 is offline Offline
95 posts
since Oct 2006
Nov 11th, 2009
0
Re: Help with script asp
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
Reputation Points: 11
Solved Threads: 7
Junior Poster in Training
Baradaran is offline Offline
88 posts
since Feb 2007
Nov 11th, 2009
0
Re: Help with script asp
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
Last edited by Jhon100; Nov 11th, 2009 at 4:21 am.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Jhon100 is offline Offline
95 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC