New page from search results

Discussion in 'Programming' started by cfnut, Mar 25, 2007.

  1. #1
    Hello everyone!! On page 1 I have a search box.
    <cfform name= "searchdb" action="businessearch.cfm" method="post" >
    <input type="text" name="crud" size="15" / value="default text" />
    <input type="submit" name="nutten" value="gosearch" />
    </cfform>

    On page 2 I display the results
    <cfform name= "curbus" action="searchresults.cfm" enctype="multipart/form-data" method="post">

    <table width="500" bordercolor="#bgcolor#" border="1">
    <tr bgcolor="#bgcolor#">
    <td width="33%">#myname#</td>
    <td><img src="image/#myimage#" alt="" / height="75" width="100"></td>
    <td>#phonenumber#</td>
    </tr>
    </table>

    I would like to have the the #myname# become a link that would go to a new page and display information regarding that user. I am not using URL variables just session variables. So the link to myname will show more detailed info about that individual.

    Thanks!!
     
    cfnut, Mar 25, 2007 IP
  2. OneWebAve

    OneWebAve Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just do something like this

    <a href="details.cfm?id=#queryname.database_id_for_row#"><img src="image.jpg"></a>

    Then on the next page, do a query like:

    <cfquery>
    SELECT *
    FROM TableName
    WHERE Table_Column_id = '#url.id#'
    </cfquery>

    <cfoutput>
    #name#, #address#, #city# etc.
    </cfoutput>
     
    OneWebAve, Mar 25, 2007 IP
  3. cfnut

    cfnut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What would I put for the '#url.id#'

    page 1 (displays the link and can be clicked on the go to next page)
    <td><a href="search2.cfm?#seadrchdb.CustId#">#CustName#</a></td>

    Page 2
    <cfquery datasource="mydns" username="user" password="pass" name="custinfo">
    Select *
    FROM tblCust
    Where CustId = '#?????#'
    </cfquery>

    In the url it looks like it passes the right variable
     
    cfnut, Mar 25, 2007 IP
  4. cfnut

    cfnut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    oops, forgot the id, it worked!!!!!

    Thank you verrrrrrrry much.
     
    cfnut, Mar 25, 2007 IP