Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing information to build a new page

Status
Not open for further replies.

movium

Technical User
Feb 18, 2002
14
SE
I got a page with a list of publications. Each publication has the following info in a database: Author, Title, Introduction and Number. What I want is to make a link from each title to a new page that gives some introductory text. I would like to avoid having a new page for each publication. In my case it would be over 40 pages. Instead it would be nice if it´s possible to pass the information from the list, on which publication the user clicked on and dynamically give that info to the new page so that the specific introduction is shown.

This is how each publication is listed.

<A href=”grfakta_intro.cfm”>#NUMBER_GRFAKTA#. #TITLE_GRFAKTA# #AUTHOR_GRFAKTA#</A>

This is the info that is supposed to be on the grfakta_intr.cfm-page

#TITLE_GRFAKTA# #NUMBER_GRFAKTA#-#YEAR_GRFAKTA#
#AUTHOR_GRFAKTA#
#INTRO_GRFAKTA#


How do I do that?

Regards
Niclas
 
In your href, include the record number of your entry. You don't give the name of your query, but the record number is stored in <queryname>.CurrentRow. Let's say the query is called BOOKS, then the reference would be:

Code:
<A href=&quot;grfakta_intro.cfm?record=#BOOKS.CurrentRow#&quot;>

Now when you arrive on the grfakta_intro.cfm page, you have a URL variable named URL.Record that contains the row number from your query. You repeat the query (you may want to look into caching for performance reasons, but with 40 records, it won't matter much), then can display the information from the &quot;clicked on&quot; entry with:

Code:
<cfoutput query=&quot;BOOKS&quot; startrow=&quot;#URL.Record#&quot; maxrows=&quot;1&quot;>
--- whatever goes here ---
</cfoutput>

Hope this helps.
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top