• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 17. Flash, ColdFusion, and the Da... > Outputting the Data in the HTML Page

Outputting the Data in the HTML Page

When it loads, dante_quiz_results.cfm now has two variables available in its URL (that is, as a querystring). In this task, you'll output those two variables into the HTML page.

In Dreamweaver, open dante_quiz_results.cfm.

The other pages of the site are finished, so this is the last page that you need to work on. It needs to accomplish two things: provide feedback, in the form of a quiz score, to the user; and insert a new record into the database.

Replace the placeholder text with the following. Link the word Return to index.cfm. Make both sets of XXX bold.

Thank you for taking the quiz, XXX

Your score is: XXX out of 5.

Return to the Dante site home page.

As you probably guessed, XXX is just temporary placeholder text, which you'll soon replace with dynamic data.

In the Bindings panel, click the New Binding (+) button to create two new URL variables: username and score.

As before, creating bindings notifies Dreamweaver that this data will be available to the page, but creating bindings does not actually change any of the code in the page. Creating bindings makes it easy to insert dynamic data in a page, so you can output it.

Select the first set of XXXs in the Document window. In the URL category of the Bindings panel, click to select username. Click the Insert button at the bottom of the panel.

Dreamweaver writes the code necessary to enable ColdFusion to output the value of the URL variable username in HTML code. As you probably guessed, Dreamweaver inserted a <cfoutput> tag.

Repeat Step 4 to insert the URL.score variable in the second set of XXXs. Save and upload dante_quiz_results.cfm.

The page is now set to output both variables from Flash. You are ready to test the page.

In the Files panel, select dante_quiz_login.cfm and press F12. Enter an email address and take the quiz.

When you are finished taking the quiz, the email address you entered in the form two pages ago and your score are output.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint