Skip to main content
Participant
April 2, 2016
Answered

display active link.

  • April 2, 2016
  • 1 reply
  • 660 views

if someone types a url into a form field and it goes into a mysql database. how do i get it to display as an active link on the display page.

    This topic has been closed for replies.
    Correct answer BKBK

    Thanks i changed all those settings without a problem...So basically i want to take a url (e.g. http://www.google.com)  thats stored in my data base and display as an active link to the url http://www.google.com


    aetb846k wrote:

    Thanks i changed all those settings without a problem...So basically i want to take a url (e.g. http://www.google.com)  thats stored in my data base and display as an active link to the url http://www.google.com

    I answered that earlier:

    <td><a href="#Recordset1.name#" title="Google homepage">Google</a></td>

    This assumes that the value of Recordset1.name is  http://www.google.com

    1 reply

    BKBK
    Community Expert
    Community Expert
    April 2, 2016

    <!--- Do select query to retrieve URL from database --->

    <cfquery name="orgDetails" datasource="myDSN">

    select orgID, webURL

    from someTBL

    where orgID=1234

    </cfquery>

    <!--- Display link on page --->

    <a href="#orgDetails.webURL#" title="Organisation X homepage">Organisation X</a>

    aetb846kAuthor
    Participant
    April 2, 2016

    <p>thanks for your time!  I tried to manipulate that code into what i have and it's throwing internal server error.  I'd like the name field to be the active link from the url they type in.    heres what i have for my output code.

    <cfoutput query="Recordset1">

        <tr>

          <td>#Recordset1.breed# </td>

          <td>#Recordset1.name#</td>

          <td>#Recordset1.bred# </td>

         <td>#Recordset1.due# </td>

        </tr></p>

    BKBK
    Community Expert
    Community Expert
    April 2, 2016

    Since you want a link, I expected something like

    <td><a href="#Recordset1.name#" title="Some title">Some name</a></td>

    In any case, the internal server error suggests something else is playing up. Could you show us your query.