{"id":495,"date":"2011-09-22T19:38:58","date_gmt":"2011-09-22T14:38:58","guid":{"rendered":"http:\/\/www.esearing.com\/v2010\/?p=495"},"modified":"2011-09-22T19:38:58","modified_gmt":"2011-09-22T14:38:58","slug":"cflocation-url-redirection","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2011\/09\/cflocation-url-redirection\/","title":{"rendered":"CFLocation &#8211; URL redirection"},"content":{"rendered":"<p>There are times when it is handy to redirect to another CFM or page based upon search results. The issue I had this week was due to uninformed users not knowing which option to choose. So at the beginning of my queries I check to see if they are going down the right path or of they need to be redirected to another path. Rather than throwing an error message like &#8220;Hey dummy, you picked the wrong option&#8221; I merely redirect them to the correct path. <\/p>\n<p><code>cfquery (logic to determine if the users selection is correct or not)<br \/>\n&lt;cfif #queryname.recordcount# eq 0&gt;<br \/>\n   &lt;cflocation url=\"newpage.cfm?xvar=xvalue&yvar=yvalue\"&gt;<br \/>\n&lt;\/cfif&gt;<\/code><\/p>\n<p>Another option would be to do a javascript confirm or CF9 Messagebox asking user to review their selections and continue\/cancel. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are times when it is handy to redirect to another CFM or page based upon search results. The issue I had this week was due to uninformed users not knowing which option to choose. So at the beginning of &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2011\/09\/cflocation-url-redirection\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16,24],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-code","category-coldfusion","category-snippets-quick-code-tips-for-single-elements-attributes-or-details"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":3,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":498,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/495\/revisions\/498"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}