How to link text links from db?

Results 1 to 3 of 3

Thread: How to link text links from db?

  1. #1
    Join Date
    Dec 1969

    Default How to link text links from db?

    Hello. I know that if I insert a form with then I can use http:// + (url from db) to create a hyperlink in my display page.<BR><BR>However, I did not do that. I typed the into the db...and when I view the db, I see only text links like:<BR><BR><BR>How do I make them hyperlinks? Is there a line of code that does that? Or just start over with the first idea?<BR><BR>Thanks<BR><BR>PS. If this is confusing. Imagine this. A database with 10 columns, each with a url. Then, the view.asp page displays that db. Ok, so you see a list of 10 urls. But they are text links. What code can make them hyperlinks? Keep in mind, the recordset is like by itself.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How to link text links from db?

    Not quite sure I understand what you are saying, but the following will display HREF&#039s the way you want (I think).<BR><BR>Assuming the field(s) in the database are...<BR>URL - holds the<BR>URL_Text - hold the text to be associated with this URL<BR><BR><BR>Response.Write "&#060;A HREF=&#039" & rst("URL") & &#039&#062;" & rst("URL_Text") & "&#060;/A&#062;"<BR><BR><BR>HTH<BR><BR>Jerry

  3. #3
    Also Joel (Coincidence?) Guest

    Default RE: How to link text links from db?

    Hi Joel,<BR>If I understand the question you just need to add the anchor tag html text in the field with the url.<BR><BR>To clarify:<BR>You are storing this: in a field.<BR><BR>You need to store this: &#060;a href=;;/a&#062;<BR><BR>The use of single or double quote marks as part of the string is where it gets a little fuzzy for me. You&#039ll need to test it. As long as your url&#039s have no embedded spaces, or as long as you url encode them, you should be OK without adding quote marks.<BR><BR>Now, with all that being said I think Jerry&#039s answer is the best solution, i.e. do your user interface code in the asp page and just store the url in the database. Someday you may want to pull those url&#039s out of the db for something else and if you have all that html wrapper stored you&#039ll wish you had done it differently. Also, you&#039ll be replicating a whole bunch of html text in each field that just eats up space in your database.<BR><BR>HTH,<BR>Joel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts