Skip to main content
Inspiring
April 25, 2008
Question

Setting up a link

  • April 25, 2008
  • 1 reply
  • 386 views
I put my query output in a table :
<td>#qry.field_name#</td>

How do I create a link for this ? Using <td><a href="#qry.field_name#"></a></td> does not work.
If I click on the value inside #qry.field_name#, I want to take that value and open another page. It seems simple enought, but I cannot seem to get it to work.

Thanks for any help.
    This topic has been closed for replies.

    1 reply

    Inspiring
    April 25, 2008
    This will take you to a page that has the same name as qry.field_name

    <cfoutput>
    <td><a href="#qry.field_name#">#qry.field_name#</a></td>
    <cfoutput>

    This would take you to a page named somepage.cfm and add a URL parameter of
    id to it:

    <cfoutput>
    <td><a href="somepage.cfm?id=#qry.field_name#">#qry.field_name#</a></td>
    <cfoutput>


    --
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com


    "trojnfn" <webforumsuser@macromedia.com> wrote in message
    news:fur876$hie$1@forums.macromedia.com...
    >I put my query output in a table :
    > <td>#qry.field_name#</td>
    >
    > How do I create a link for this ? Using <td><a
    > href="#qry.field_name#"></a></td> does not work.
    > If I click on the value inside #qry.field_name#, I want to take that value
    > and
    > open another page. It seems simple enought, but I cannot seem to get it to
    > work.
    >
    > Thanks for any help.
    >

    trojnfnAuthor
    Inspiring
    April 28, 2008
    I tried that and it did not work.

    My qry.field_name is a pdf, gif, or jpg file, stored in a column in a table.

    What I want to do is display the file name after I query the table: <td>#qry.field_name.pdf#</td>

    If I click on the qry.field_name.pdf, I want to open the pdf file, if it is qry.field_name.jpg, the open the jpg file, etc.,
    that is why I need to setup the link.

    What else can I do to display ?
    Inspiring
    April 28, 2008
    quote:

    Originally posted by: trojnfn
    I tried that and it did not work.

    My qry.field_name is a pdf, gif, or jpg file, stored in a column in a table.

    What I want to do is display the file name after I query the table: <td>#qry.field_name.pdf#</td>

    If I click on the qry.field_name.pdf, I want to open the pdf file, if it is qry.field_name.jpg, the open the jpg file, etc.,
    that is why I need to setup the link.

    What else can I do to display ?

    If you are storing the files in your database, I don't think you can open them with a web browser. What most people do is to store the file as a file somewhere, and store the path to in their db.