What's wrong with this bit of code?
Well nothing as long as the page is viewed with a browser. However a cgi variable in your code may not exist if a spider rather than a browser looks at your site. This includes spiders like google. Your site may not be indexed by search engines if you don't handle CGI variables correctly.
So how do you check if you site works without cgi variables being set?
- Use a HTML validator. Most validators don't send the same header information as a browser would.
- Use HTTP live headers. You can record, play back and edit all header information that is sent from a browser. With HTTP live headers it's easy to make a request via a browser with no header information.
The spider safe version of the code:
<cfset languages = CGI.HTTP_ACCEPT_LANGUAGE>