<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Dev Pages &#187; Random Thoughts</title>
	<atom:link href="http://www.n8williams.com/devblog/category/random_thoughts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.n8williams.com/devblog</link>
	<description>A knowledge base for simple (and beyond) web applications development</description>
	<lastBuildDate>Mon, 07 Nov 2011 08:31:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get the domain entered from the request. Coldfusion CGI.HTTP_HOST</title>
		<link>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:40:11 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=27</guid>
		<description><![CDATA[Use CGI.HTTP_HOST
Issue: mydomain.com gets load-balanced and uses multiple servers. CGI.SERVER_NAME will not return &#8216;mydomain&#8217; but will return &#8217;sever1&#8242; or &#8217;server2&#8242; etc. 
I want to check the request URL, and if it does not include www, re-locate to www.mydomain/pagerequested?event=eventrequested

&#60;cfset secureurl = xmlParse(expandPath("/mydevenvironment/settings.xml")).
settings.secureHost.xmlText /&#62;
		&#60;cfloop collection="#CGI#" item="field"&#62;
			&#60;cfoutput&#62;#field#: #CGI[field]# &#60;BR&#62;&#60;/cfoutput&#62;
		&#60;/cfloop&#62;
		&#60;cfif NOT REFind("www\.", CGI.HTTP_HOST)&#62;
			
			&#60;cfif CGI.HTTPS EQ "on"&#62;
				&#60;cfset theURLBase = secureurl [...]]]></description>
			<content:encoded><![CDATA[<p>Use CGI.HTTP_HOST</p>
<p>Issue: mydomain.com gets load-balanced and uses multiple servers. CGI.SERVER_NAME will not return &#8216;mydomain&#8217; but will return &#8217;sever1&#8242; or &#8217;server2&#8242; etc. </p>
<p>I want to check the request URL, and if it does not include www, re-locate to www.mydomain/pagerequested?event=eventrequested</p>
<div class="text-box"><code><!--- Redirect to the site that corresponds to the securehost ---><br />
&lt;cfset secureurl = xmlParse(expandPath("/mydevenvironment/settings.xml")).<br />
settings.secureHost.xmlText /&gt;<br />
		&lt;cfloop collection="#CGI#" item="field"&gt;<br />
			&lt;cfoutput&gt;#field#: #CGI[field]# &lt;BR&gt;&lt;/cfoutput&gt;<br />
		&lt;/cfloop&gt;<br />
		&lt;cfif NOT REFind("www\.", CGI.HTTP_HOST)&gt;<br />
			<!--- If a secure request, keep the https, otherwise just go to http---><br />
			&lt;cfif CGI.HTTPS EQ "on"&gt;<br />
				&lt;cfset theURLBase = secureurl /&gt;<br />
			&lt;cfelse&gt;<br />
				&lt;cfset theURLBase = REREplace(secureurl,"https:","http:")/&gt;<br />
			&lt;/cfif&gt;<br />
			&lt;cfoutput&gt;#theURLBase#&lt;/cfoutput&gt;<br />
			&lt;cflocation url='#theURLBase##CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#'addtoken="false"&gt;<br />
		&lt;/cfif&gt;</code></div>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cart/Session Data vs Form data</title>
		<link>http://www.n8williams.com/devblog/random_thoughts/cartsession-data-vs-form-data</link>
		<comments>http://www.n8williams.com/devblog/random_thoughts/cartsession-data-vs-form-data#comments</comments>
		<pubDate>Fri, 23 May 2008 18:38:11 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=10</guid>
		<description><![CDATA[So I was making a form that was originally one page, to submit and order.
It got more complex when I learned I should probably get the tax/subtotal/verification from our order processor before submitting the final order.
So now I had a 2 part form. Part one: Enter line items Process part one: Calculate subtotal/tax and list [...]]]></description>
			<content:encoded><![CDATA[<p>So I was making a form that was originally one page, to submit and order.</p>
<p>It got more complex when I learned I should probably get the tax/subtotal/verification from our order processor before submitting the final order.</p>
<p>So now I had a 2 part form. Part one: Enter line items Process part one: Calculate subtotal/tax and list info for verification Part2:Verify info and submit for final order processing.</p>
<p>Still, just 2 steps, not a very big deal, right? I didn&#8217;t want to worry about the session, a cart, etc. I ended up passing the info from step 1 (lineitems) and cloning it on step two into hidden form values, so these lineItems would be available when step 2 was processed.</p>
<p>The kicker for me to switch to use a cart was that in order for me to calculate the price from the lineItems, I needed the price and the totals to not be form data that could be manipulated by the user. Instead of adding hidden price fields on the form, and worry about that specific security issue of modifying form data pricing, I just decided to keep track of the pricing in the session, on the cart, which also reduced my amount of form value overhead, bu mades things a little more complex.</p>
<p>Oh well, I needed to get familiar with our shopping cart object anyways.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/random_thoughts/cartsession-data-vs-form-data/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

