Includes with querystrings

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Includes with querystrings

    I need to include 3 files that have grabbed database info using a parameter
    passed in their querystrings. I keep getting a 'file not found' error when I
    do the include with a querystring like so:

    <cfinclude template="Part1.cfm?dbid=100">
    <cfinclude template="Part2.cfm?dbid=100">
    <cfinclude template="Part3Local.cfm?dbid=100">

    Is there another way to do this?

    ccsimmons Guest

  2. Similar Questions and Discussions

    1. Help w/ Includes & CSS
      for some reason after I upgraded from MX 2004 to DreamWeaver 8, my site doesn't doesn't format with the style sheet i used previously in 2004. Also...
    2. Querystrings in HTML/javascript
      Hi I am passing a querystring to a html page as I would to say an asp page, so http://www.mysite.com/mypage.html?thepopup=page2.html I want...
    3. query about querystrings
      I've been building an Intranet app; and have used hidden fields exclusively to pass one or two things from one page to another. However, now I...
    4. Includes...
      as you said... put the data in a page and use the INCLUDE command -- ---------------------------------------------------------- Curt...
    5. XP includes ???????
      ah, ok, thanks
  3. #2

    Default Re: Includes with querystrings

    On Wed, 23 Feb 2005 15:17:51 +0000 (UTC), ccsimmons wrote:
    > I need to include 3 files that have grabbed database info using a parameter
    > passed in their querystrings. I keep getting a 'file not found' error when I
    > do the include with a querystring like so:
    >
    > <cfinclude template="Part1.cfm?dbid=100">
    You don't need or want a querystring when you're including a file. A query
    string is for an HTTP request. <cfinclude> doesn't perform its own HTTP
    request, it simply includes (big hint there) the contents of the included
    file into the including file (*).

    Just set the variables in the including file, and use them in the included
    file.

    [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p63.htm[/url]
    [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p70.htm[/url]

    --

    Adam

    (*) It's not quite that straight forward or transparent, but for the
    purposes of this question, that's what it does.
    Adam Cameron Guest

  4. #3

    Default Re: Includes with querystrings

    Alternately, you can use <cfmodule> to "include" the file:

    <cfmodule template="Part1.cfm" dbid="100">

    Just know that using <cfmodule> is like calling a custom tag. Therefore in
    "Part1.cfm", you'd have to check for attributes.dbid instead of url.dbid

    HTH

    cf_menace Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139