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!

Can cfelse and cfoutput redirect to a page?

Status
Not open for further replies.

richj55

Technical User
Jul 14, 2000
30
US
I am currently using the following code, but I would rather have the cfoutput redirect to one web page and the cfelse redirect to another page. Is that possible?

<cfoutput>
<div align=&quot;right&quot;>#DateFormat (Now())# #TimeFormat(Now())# </div><br>
<br>
Thank you for your request #form.firstname#. We will process your request and contact you as soon as possible.<BR>
<br>
<div align=&quot;center&quot;><a href=&quot;../home.html&quot;>Return to Homepage</a> </div>
</cfoutput>


<cfelse>

<H3>You are missing a required piece of information for this form to be processed.</H3>
<br>
Please <a href=&quot;javascript:history.go(-1)&quot;>Click here</a> to go back and complete
all fields marked with an asterisk(<font color=&quot;#FF0000&quot;>*</font>).
</CFIF>
 
I'd use CFINCLUDE rather than CFLOCATION to select the new page:
* if you forget to code cflocation ADDTOKEN=NO, cflocation shows CFID and CFTOKEN as URL paramaters in the browser's address bar. This is known security hazard.
* CFLOCATION clobbers cookies, session variables, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top