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

Chapter 7. Maintaining State > Browser Redirection

7.3. Browser Redirection

At times, you may wish to redirect a user's browser to a location other than the current template. This is generally handled using the CFLOCATION tag. The following example creates a drop-down box listing several web sites. Choosing one of the sites and clicking on the Go button posts the form to itself and uses the CFLOCATION tag to redirect the user to the selected web site.

<CFIF IsDefined('Form.Go')>
  <CFLOCATION URL="http://#Goto#" ADDTOKEN="No"> 
</CFIF>

<B>Please choose a location:</B><BR>
<FORM ACTION="Go.cfm" METHOD="post">
  <SELECT NAME="Goto">
    <OPTION VALUE="www.allaire.com" Selected>Allaire</OPTION>
    <OPTION VALUE="www.yahoo.com">Yahoo</OPTION>
    <OPTION VALUE="www.amkor.com">Amkor</OPTION>
  </SELECT>
<INPUT TYPE="Submit" NAME="Go" VALUE="Go"></FONT></TD></FORM>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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