Using <cfif> to auto redirect to different pages

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Using <cfif> to auto redirect to different pages

    I wanted to use the <cfif> statement to create links to various pages that will
    load in the same browser window if the statement is true, for example;

    <cfif page = "page1">
    Automatically load page1.cfm into this currently open window.
    </cfelseif page = "page2">
    Automatically load page2.cfm into this currently open window.

    etc, etc.

    I'm not sure what the syntax is for this operation, <http> and <httpparam>
    tags perhaps?



    mitel_ford Guest

  2. Similar Questions and Discussions

    1. Custom Error Pages - 404 File not found & 301 redirect
      Hello, We are preparing to launch a new site and would like to create a custom error page for 404 - File not found. I would also like to create...
    2. Roles based Forms Auth - denied pages redirect
      I would like to know how, if at all possible, a custom redirect page can be setup for when a users role(s) are denied to a page. The default...
    3. Auto Dating pages are printed or updated
      I am trying to find a way to have the date print on the pages of my document (file), simaler to how Excel does with its fotter and header...
    4. Auto add pages when flowing text
      Hi all, I am having a problem related to the previous posts: I am flowing text into linked text boxes on page which were set up on the master...
    5. Page auto redirect to old domain
      Hey guys, I have something a bit strange happening, I was hoping you could help me with. I transferred a site to a new server and domain (HTML...
  3. #2

    Default Re: Using <cfif> to auto redirect to different pages

    <cfif page = "page1">
    <cfinclude template="page1.cfm">
    <cfelseif page = "page2">
    <cfinclude template="page2.cfm">
    </cfif>
    Frickie Guest

  4. #3

    Default Re: Using <cfif> to auto redirect to different pages

    If you are going to have many choices based on a single variable then you are
    better off using cfswitch.


    <cfswitch expression="#page#">
    <cfcase value="page1">
    <cfinclude template="page1.cfm">
    </cfcase>

    <cfcase value="page2">
    <cfinclude template="page2.cfm">
    </cfcase>

    <cfcase value="page3">
    <cfinclude template="page3.cfm">
    </cfcase>

    <cfcase value="page4">
    <cfinclude template="page4.cfm">
    </cfcase>

    <cfcase value="page5">
    <cfinclude template="page5.cfm">
    </cfcase>
    </cfswitch>

    Stressed_Simon 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