cffaq.com


Hosted and maintained by Ben Forta. Designed by Trilemetry.
Language:
    © 2002-2007 Ben Forta. All Rights Reserved  
<Home> <FAQ> <Question> <About>

Question

I have a page with cfincludes for the header and footer. I want to add a cfmail form in the footer for contacting the webmaster. Once the e-mail is sent I want to add a link to the full URL of the page the user was on when originally clicking to submit comments (i.e. "return to the page I was at"). How do I record the page I was at?
When you create your link to the feedback page, simply append the current file name. For example: <cfset ref = cgi.script_name & "?" & cgi.query_string> <a href="feedback.cfm?ref=#urlEncodedFormat(ref)#"> Your feedback form will look for the value, url.ref, which is the url (including any query string information). You should be sure to store the value as a hidden form field so that the value doesn't expire. After the form is submitted you could then simply use cflocation to push the user back, or provide a dynamic link back. This is also useful in cases where you have a login form. You could modify the technique above so that when a user is forced to logon, they then get directed to the page they had originally requested.

Comments

Britney (19-Oct-07)
The site\'\'s very professional! Keep up the good work! Oh yes, one extra comment - maybe you could add more pictures too! So, good luck to your team!

Add Your Comments

Your Name:
Your E-Mail:
Comment:
Verification: Copy the text on the left:

<submit question>