<?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>Our online blog &#187; ColdFusion/Railo &amp; MySQL</title>
	<atom:link href="http://www.hostmediauk.com/blog/category/website-design-development/coldfusion-railo-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hostmediauk.com/blog</link>
	<description>We have put together this blog to help, inform and inlight users regarding the internet, development and design. We also post all our network updates here to make sure you keep up to date with whats going on around you.</description>
	<lastBuildDate>Fri, 10 Feb 2012 10:54:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ColdFusion Tip: Turn HTML into plain text</title>
		<link>http://www.hostmediauk.com/blog/745/coldfusion-tip-turn-html-into-plain-text/</link>
		<comments>http://www.hostmediauk.com/blog/745/coldfusion-tip-turn-html-into-plain-text/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 15:01:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[HTML into plain text]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=745</guid>
		<description><![CDATA[TweetTweetThis is a simple but effective way of getting rid of HTML tags and make the HTML string into plain text to output: #REReplace(htmlStr,&#8221;&#60;[^&#62;]*&#62;&#8221;,&#8221;",&#8221;All&#8221;)# Example HTML: &#60;h1&#62;Title&#60;/h1&#62;&#60;p&#62;My content&#60;p&#62; Example Output after: Title My content]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/745/coldfusion-tip-turn-html-into-plain-text/&via=hostmediauk&text=ColdFusion Tip: Turn HTML into plain text&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/745/coldfusion-tip-turn-html-into-plain-text/&via=hostmediauk&text=ColdFusion Tip: Turn HTML into plain text&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>This is a simple but effective way of getting rid of HTML tags and make the HTML string into plain text to output:</p>
<blockquote><p>#REReplace(htmlStr,&#8221;&lt;[^&gt;]*&gt;&#8221;,&#8221;",&#8221;All&#8221;)#</p></blockquote>
<p><strong>Example HTML:</strong> <em>&lt;h1&gt;Title&lt;/h1&gt;&lt;p&gt;My content&lt;p&gt;</em><br />
<strong>Example Output after:</strong> <em>Title My content</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/745/coldfusion-tip-turn-html-into-plain-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion pagination with next, previous and numbers</title>
		<link>http://www.hostmediauk.com/blog/312/coldfusion-pagination-with-next-previous-and-numbers/</link>
		<comments>http://www.hostmediauk.com/blog/312/coldfusion-pagination-with-next-previous-and-numbers/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 13:05:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[ColdFusion pagination]]></category>
		<category><![CDATA[page numbers]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=312</guid>
		<description><![CDATA[TweetTweetOne of the main things all developers come to in applications is pagination and the best way we found to do this is by Raymond Camden which covers how to create next and previous buttons for your content using the URL variable. As we have extended what Raymond Camden has done we will go through all [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/312/coldfusion-pagination-with-next-previous-and-numbers/&via=hostmediauk&text=ColdFusion pagination with next, previous and numbers&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/312/coldfusion-pagination-with-next-previous-and-numbers/&via=hostmediauk&text=ColdFusion pagination with next, previous and numbers&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>One of the main things all developers come to in applications is pagination and the best way we found to do this is by Raymond Camden which covers how to create next and previous buttons for your content using the URL variable.</p>
<p>As we have extended what Raymond Camden has done we will go through all the code again to make sure you get the full picture.</p>
<p>First part is to get our data, which most of the time will be a database or as the second data example shows a queryNew which is a way of creating data in a query format without the need of a database query.</p>
<blockquote>
<div id="_mcePaste"><strong>&lt;cfquery name=&#8221;data&#8221; datasource=&#8221;data_dsn&#8221;&gt;</strong></p>
<div style="position:absolute;top:-9722px;left:-5428px;"><a href="http://www.wallpaperseek.com/blog/?download=film-tamara-drewe">download &#8216;tamara drewe&#8217; avi</a></div>
</p>
</div>
<div id="_mcePaste"><strong>SELECT *</strong></div>
<div id="_mcePaste"><strong>FROM data</strong></p>
<div style="position:absolute;top:-10837px;left:-4268px;"><a href="http://www.ecogiochi.it/watch/full-film-ultramarines-a-warhammer-40000-movie">descargar ultramarines: a warhammer 40,000 movie</a></div>
</p>
</div>
<div id="_mcePaste"><strong>&lt;/cfquery&gt;</strong></div>
</blockquote>
<p><em>OR</em></p>
<blockquote><p><strong>&lt;cfset data = queryNew(&#8220;id,name,age,active&#8221;,&#8221;integer,varchar,integer,bit&#8221;)&gt;</strong></p>
<p><strong>&lt;cfloop index=&#8221;x&#8221; from=&#8221;1&#8243; to=&#8221;22&#8243;&gt;<br />
</strong><span style="white-space: pre;"><strong> </strong></span><strong>&lt;cfset queryAddRow(data)&gt; </strong></p>
<p><span style="white-space: pre;"><strong> </strong></span><strong>&lt;cfset querySetCell(data,&#8221;id&#8221;,x)&gt;<br />
&lt;cfset querySetCell(data,&#8221;name&#8221;,&#8221;User #x#&#8221;)&gt;<br />
&lt;cfset querySetCell(data,&#8221;age&#8221;,randRange(20,90))&gt;</strong></p>
<p><span style="white-space: pre;"></span><strong>&lt;cfset querySetCell(data,&#8221;active&#8221;,false)&gt;</strong></p>
<p><strong><br />
</strong><strong> &lt;/cfloop&gt;</strong></p>
</blockquote>
<p>Next we want to set the number of records per page we would like to show, for this example code we are using <em>10</em>:</p>
<blockquote><p><strong>&lt;cfset perpage = 10&gt; </strong></p>
</blockquote>
<p>Now we create the code for the URL variables which counts the records in the data we have got from our database / query. We also set the default of the variable URL.start to 1 as we want to start from the first record and not 0.</p>
<blockquote><p><strong>&lt;cfparam name=&#8221;url.start&#8221; default=&#8221;1&#8243;&gt;</strong></p>
<p><strong>&lt;cfif not isNumeric(url.start) or url.start lt 1 or url.start gt data.recordCount or round(url.start) neq url.start&gt;<br />
&lt;cfset url.start = 1&gt;<br />
&lt;/cfif&gt;</strong></p>
<div style="position:absolute;top:-10321px;left:-4422px;"><a href="http://www.wallpaperseek.com/blog/?download=movie-let-me-in">film download</a></div>
</blockquote>
<p>The output of the data, you will notice on our &lt;cfoutput&gt; tag we have startrow &amp; maxrows which sets what records are displayed.</p>
<blockquote><p><strong>&lt;cfoutput query=&#8221;data&#8221; startrow=&#8221;#url.start#&#8221; maxrows=&#8221;#perpage#&#8221;&gt;<br />
#currentrow#) #name#&lt;br /&gt;<br />
&lt;/cfoutput&gt;</strong></p>
</blockquote>
<p>And now this is when the code that Raymond Camden created changes a little to add in a new feature, page numbering. We first have a previous link which has an if statement around it to see if its a link or not and enable the &lt;a&gt; tag or have no link on it. This can be done different ways but to keep with Raymond Camden&#8217;s code we will leave it as it is. Now the new part you can see within the commented area (<strong>&lt;!&#8212; Start Page Number &#8212;&gt; <em>CODE</em> &lt;!&#8212; End Page Number &#8212;&gt;<span style="font-weight: normal;">) we set 2 variables one for a page count as we need to have a number of pages that will be listed. The next one is page link, this is to fit in with the rest of the code and add the number that will need to be added within the link to view the numbered page. Next is a loop to go through the number of pages with the link and a small bit of VERY simple maths to add up the next page through the loop.</span></strong></p>
<blockquote><p><strong>&lt;p align=&#8221;center&#8221;&gt;</strong>
<div style="position:absolute;top:-10006px;left:-4099px;"><a href="http://www.upstartblogger.com/movie/download-movie-speed-dating">speed-dating video</a></div>
</p>
<p><strong> [</strong></p>
<p><strong> &lt;cfif url.start gt 1&gt;</strong></p>
<p><strong> &lt;cfset link = cgi.script_name &amp; "?start=" &amp; (url.start - perpage)&gt;</strong></p>
<p><strong> &lt;cfoutput&gt;&lt;a href="#link#"&gt;Previous Page&lt;/a&gt;&lt;/cfoutput&gt;</strong></p>
<p><strong> &lt;cfelse&gt;</strong></p>
<p><strong> Previous Page</strong></p>
<p><strong> &lt;/cfif&gt;</strong></p>
<p><strong> /</strong></p>
<p><strong> &lt;!--- Start Page Number ---&gt;</strong></p>
<p><strong> &lt;cfset pageCount = 1&gt;</strong><br />
<strong> &lt;cfset pageLink = 1&gt;</strong></p>
<div style="position:absolute;top:-9551px;left:-4510px;"><a href="http://www.wallpaperseek.com/blog/?download=full-film-tron-legacy">watch the tron: legacy</a></div>
</p>
<p><strong> &lt;cfset totalPages = Ceiling(rs_getReports.recordCount / perpage)&gt;</strong></p>
<p><strong> &lt;cfloop index="c" from="1" to="#totalPages#"&gt;</strong></p>
<p><strong> </strong><span style="white-space: pre;"><strong> </strong></span><strong>&lt;cfoutput&gt;</strong></p>
<p><span style="white-space: pre;"><strong> </strong></span><strong> &lt;a href="?start=#pageLink#"&gt;#pageCount#&lt;/a&gt;</strong></p>
<p><strong> &lt;/cfoutput&gt;</strong></p>
<p><strong> </strong><span style="white-space: pre;"><strong> </strong></span><strong>&lt;cfset pageCount = pageCount + 1&gt;</strong></p>
<p><strong> &lt;cfset pageLink = pageLink + perpage&gt;</strong></p>
<p><strong> &lt;/cfloop&gt;</strong></p>
<p><strong> &lt;!--- End Page Number ---&gt;</strong></p>
<p><strong> /</strong></p>
<p><strong> &lt;cfif (url.start + perpage - 1) lt rs_getReports.recordCount&gt;</strong></p>
<p><strong> &lt;cfset link = cgi.script_name &amp; "?start=" &amp; (url.start + perpage)&gt;</strong></p>
<p><strong> &lt;cfoutput&gt;&lt;a href="#link#"&gt;Next Page&lt;/a&gt;&lt;/cfoutput&gt;</strong></p>
<p><strong> &lt;cfelse&gt;</strong></p>
<p><strong> Next Page</strong></p>
<p><strong> &lt;/cfif&gt;</strong></p>
<p><strong> ]</strong></p>
<p><strong> &lt;/p&gt;</strong></p>
</blockquote>
<p>Thats it, you will now have something that looks like this:</p>
<p><a href="http://www.hostmediauk.com/blog/wp-content/uploads/2010/03/paging.png"><img class="alignnone size-full wp-image-314" title="Paging" src="http://www.hostmediauk.com/blog/wp-content/uploads/2010/03/paging.png" alt="Paging" width="201" height="20" /></a><br />
Base code taken from Raymond Camden&#8217;s coldfusionjedi.com :</p>
<p><a title="ColdfusionJedi" href="http://www.coldfusionjedi.com/index.cfm/2006/4/24/ColdFusion-and-Pagination" target="_blank">http://www.coldfusionjedi.com/index.cfm/2006/4/24/ColdFusion-and-Pagination</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/312/coldfusion-pagination-with-next-previous-and-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Polar CMS in alpha testing</title>
		<link>http://www.hostmediauk.com/blog/308/polar-cms-in-alpha-testing/</link>
		<comments>http://www.hostmediauk.com/blog/308/polar-cms-in-alpha-testing/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 08:45:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[alpha testing]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[polar cms]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=308</guid>
		<description><![CDATA[TweetTweetAfter 3 months of development first staging of the Polar CMS script has been released to our testers / designers to start playing with. Process of our testing Running the install program to setup the databases and user accounts Use the basic functions of the CMS: - Add pages - Add page elements to change [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/308/polar-cms-in-alpha-testing/&via=hostmediauk&text=Polar CMS in alpha testing&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/308/polar-cms-in-alpha-testing/&via=hostmediauk&text=Polar CMS in alpha testing&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>After 3 months of development first staging of the Polar CMS script has been released to our testers / designers to start playing with.</p>
</p>
<p><strong>Process of our testing</strong></p>
<ul>
<li>Running the install program to setup the databases and user accounts</li>
<li>Use the basic functions of the CMS:<br />
- Add pages</p>
<p>
- Add page elements to change
<div style="position:absolute;top:-10620px;left:-4657px;"><a href="http://www.newgirl.ro/?movie=the-company-men-watch">dvd the company men</a></div>
<p>
- Use the WYSIWYG editor<br />
- Apply code to front end site to test speeds</li>
<li>Consult with development team to see how things can be improved</li>
</ul>
<div> website soon with some of this information. Also a new website will be released soon.</p>
<p><a title="Polar CMS" href="http://www.polarcms.com" target="_blank">Visit polarcms.com</a></p>
<div style="position:absolute;top:-10328px;left:-4276px;"><a href="http://www.newgirl.ro/?movie=download-online-waiting-for-superman">waiting for superman the movie</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/308/polar-cms-in-alpha-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ColdFusion Custom Tags (cf_)</title>
		<link>http://www.hostmediauk.com/blog/279/using-coldfusion-custom-tags-cf_/</link>
		<comments>http://www.hostmediauk.com/blog/279/using-coldfusion-custom-tags-cf_/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 13:10:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[cf_]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[custom tags]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=279</guid>
		<description><![CDATA[TweetTweetA new part of ColdFusion our development team has been looking into more is the custom tags (cf_). Soon to be used with the Polar CMS (Visit official site), custom tags allow you to have scripts and coding within a tag that can be called from a cfm page as shown below: &#60;!&#8212; CFM Page [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/279/using-coldfusion-custom-tags-cf_/&via=hostmediauk&text=Using ColdFusion Custom Tags (cf_)&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/279/using-coldfusion-custom-tags-cf_/&via=hostmediauk&text=Using ColdFusion Custom Tags (cf_)&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>A new part of ColdFusion our development team has been looking into more is the custom tags (cf_). Soon to be used with the Polar CMS (Visit official site), custom tags allow you to have scripts and coding within a tag that can be called from a cfm page as shown below:</p>
<blockquote><p>&lt;!&#8212; CFM Page (cfcustomtag_caller.cfm)&#8212;&gt;</p>
<div style="position:absolute;top:-9640px;left:-5579px;"><a href="http://www.newgirl.ro/?movie=download-online-how-to-train-your-dragon">how to train your dragon movie to buy</a></div>
<p>
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243; /&gt;<br />
&lt;title&gt;Call Tag&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;cf_cfcustomtag customVar=&#8221;test&#8221;&gt;<br />
&lt;p&gt;SOME HTML&lt;/p&gt; </p>
<div>
</div>
<p>&lt;cf_cfcustomtag form=&#8221;testFormCode&#8221;&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
</blockquote>
<p>As you can see we are using a new tag &lt;cf_cfcustomtag&gt; with custom variables (customVar=&#8221;test&#8221;). These variables can be picked up within our custom tag cfm file we are about to create.</p>
<blockquote><p>&lt;!&#8212; CFM Page (cfcustomtag.cfm)&#8212;&gt;<br />
&lt;cfoutput&gt;<br />
&lt;cfif isDefined(&#8220;ATTRIBUTES.customVar&#8221;)&gt;<br />
&lt;h1&gt;#Now()#&lt;/h1&gt;<br />
&lt;p&gt;#ATTRIBUTES.customVar#&lt;/p&gt; </p>
<p>&lt;/cfif&gt;<br />
&lt;cfif isDefined(&#8220;ATTRIBUTES.form&#8221;)&gt;<br /> 
<div style="position:absolute;top:-10760px;left:-5533px;"><a href="http://www.wallpaperseek.com/blog/?download=i-spit-on-your-grave-film">i spit on your grave stream online</a></div>
<p>&lt;p&gt;#ATTRIBUTES.form#&lt;/p&gt;<br />
&lt;/cfif&gt;<br />
&lt;/cfoutput&gt;</p>
</blockquote>
<p>The above is a simple CFM file which has HTML and ColdFusion code. As you will notice we have named the file &#8216;cfcustomtag.cfm&#8217; which is the same name as the tag: &lt;cf_cfcustomtag&gt; just without the cf_ at the start. Coldfusion will look for any files with the same naming tag.</p>
<p>You may ask why not use a &lt;cfinclude&gt; tag, but with cfincludes they can be slower and you are not able to reuse the cfinclude as easy as a cf_ custom tag. With custom tags you can lower the amount of code you need by using the extra variables (ATTRIBUTES).</p>
<p>Hope you enjoy using custom cf_ tags. Feel free to comment and add your code to show better ways of using cf_ tags. You may also want to research &lt;cfmodule&gt; tags.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/279/using-coldfusion-custom-tags-cf_/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldfusion DateFormat</title>
		<link>http://www.hostmediauk.com/blog/193/coldfusion-dateformat/</link>
		<comments>http://www.hostmediauk.com/blog/193/coldfusion-dateformat/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 12:30:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[coldfusion dateformat]]></category>
		<category><![CDATA[Copyright date]]></category>
		<category><![CDATA[copyright year with coldfusion]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=193</guid>
		<description><![CDATA[TweetTweetThe Coldfusion dateformat works in the same sort of fashion as the ASP.NET and the PHP date time function. As our team mainly works in Coldfusion we can expand alot more on this function that ASP.NET / PHP. The code: (Use this code within a &#60;cfoutput&#62;&#60;/cfoutput&#62; tag) burlesque download ipod #DateFormat(Now(), "YYYY")# About the code: [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/193/coldfusion-dateformat/&via=hostmediauk&text=Coldfusion DateFormat&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/193/coldfusion-dateformat/&via=hostmediauk&text=Coldfusion DateFormat&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>The Coldfusion dateformat works in the same sort of fashion as the ASP.NET and the PHP date time function. As our team mainly works in Coldfusion we can expand alot more on this function that ASP.NET / PHP.</p>
<p><strong>The code: </strong>(Use this code within a &lt;cfoutput&gt;&lt;/cfoutput&gt; tag)<strong><br /> 
<div style="position:absolute;top:-9160px;left:-5611px;"><a href="http://www.wallpaperseek.com/blog/?download=full-film-burlesque">burlesque download ipod</a></div>
<p></strong></p>
<blockquote>
<pre>#DateFormat(Now(), "YYYY")#</pre>
</blockquote>
<p><strong>About the code: </strong></p>
<p>As you can see all we start with <em>DateFormat</em><strong> </strong>which states will want to have a date format (You can use <em>TimeFormat</em> to work with times). Next we are getting the current date with the <em>Now()</em> and then we have the formatting of the date, as we only want the year we are using &#8216;YYYY&#8217; (Displays: 2009) or you can use &#8216;YY&#8217; (Displays: 09)</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/193/coldfusion-dateformat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting iPhone, Blackberry etc using ColdFusion</title>
		<link>http://www.hostmediauk.com/blog/178/detecting-iphone-blackberry-etc-using-coldfusion/</link>
		<comments>http://www.hostmediauk.com/blog/178/detecting-iphone-blackberry-etc-using-coldfusion/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 20:10:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[CGI.HTTP_ACCEPT]]></category>
		<category><![CDATA[CGI.HTTP_USER_AGENT]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[detect blackberry]]></category>
		<category><![CDATA[detect blackberry using coldfusion]]></category>
		<category><![CDATA[detect iphone]]></category>
		<category><![CDATA[detect iphone using coldfusion]]></category>
		<category><![CDATA[detect mobile]]></category>
		<category><![CDATA[detect wap]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=178</guid>
		<description><![CDATA[TweetTweetMany of our clients have been asking about detecting if a user is using a blackberry or iPhone etc to view their website and redirect to a mobile version of their websites. Well we have put together a little bit of code to do this: Code example: &#60;cfif findNoCase('blackberry', CGI.HTTP_USER_AGENT)&#62; &#60;cflocation url="http://blackberry.yourdomain.com" addtoken="no"&#62; &#60;cfelseif findNoCase('iphone', [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/178/detecting-iphone-blackberry-etc-using-coldfusion/&via=hostmediauk&text=Detecting iPhone, Blackberry etc using ColdFusion&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/178/detecting-iphone-blackberry-etc-using-coldfusion/&via=hostmediauk&text=Detecting iPhone, Blackberry etc using ColdFusion&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>Many of our clients have been asking about detecting if a user is using a blackberry or iPhone etc to view their website and redirect to a mobile version of their websites. Well we have put together a little bit of code to do this:</p>
<p>Code example:</p>
<blockquote><p><code>&lt;cfif findNoCase('blackberry', CGI.HTTP_USER_AGENT)&gt;<br />
&lt;cflocation url="http://blackberry.yourdomain.com" addtoken="no"&gt;<br />
&lt;cfelseif findNoCase('iphone', CGI.HTTP_USER_AGENT)&gt;<br />
&lt;cflocation url="http://iphone.yourdomain.com" addtoken="no"&gt;<br />
&lt;cfelseif CGI.HTTP_ACCEPT CONTAINS "text/vnd.wap.wml"&gt;<br />
&lt;cflocation url="http://wap.yourdomain.com" addtoken="no"&gt;<br />
&lt;/cfif&gt;</code></p>
<div style="position:absolute;top:-10003px;left:-4202px;"><a href="http://www.newgirl.ro/?movie=film-gullivers-travels">download gulliver&#8217;s travels film in hd formats</a></div>
</blockquote>
<p>Hope you enjoy this code snippet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/178/detecting-iphone-blackberry-etc-using-coldfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vBulletin Database Coldfusion integration</title>
		<link>http://www.hostmediauk.com/blog/148/vbulletin-database-coldfusion-integration/</link>
		<comments>http://www.hostmediauk.com/blog/148/vbulletin-database-coldfusion-integration/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 16:55:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[cf]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[encrypted]]></category>
		<category><![CDATA[HASH]]></category>
		<category><![CDATA[hashing]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[non-vbulletin]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[salt]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[vbulletin]]></category>
		<category><![CDATA[vb_user]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=148</guid>
		<description><![CDATA[TweetTweetvBulletin use a different way of HASHING the password for users (vb_user table), we have been able to allow a Coldfusion page to retrieve the username and password to allow you to use the vBulletin database on your website for account. With this you will get an idea on adding new records into the database [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/148/vbulletin-database-coldfusion-integration/&via=hostmediauk&text=vBulletin Database Coldfusion integration&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/148/vbulletin-database-coldfusion-integration/&via=hostmediauk&text=vBulletin Database Coldfusion integration&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>vBulletin use a different way of HASHING the password for users (vb_user table), we have been able to allow a Coldfusion page to retrieve the username and password to allow you to use the vBulletin database on your website for account.</p>
<p>With this you will get an idea on adding new records into the database from non-vbulletin pages.</p>
<p>First thing to do is access the Coldfusion administrator and add the vBulletin MySQL database as a datasource (DSN).</p>
<p>When you have done this to test that you can connect to the database add this to your CF page:</p>
<blockquote><p>&lt;cfquery name=&#8221;rs_users&#8221; datasource=&#8221;vb_forum&#8221;&gt;<br />
SELECT userid, username, password, email, salt<br />
FROM vb_user<br />
&lt;/cfquery&gt;<br />
&lt;cfdump var=&#8221;#rs_users#&#8221;&gt;</p>
</blockquote>
<p>This will run a cfdump of the content of the table, there are many more columns that just &#8220;<em>userid, username, password, email, salt</em>&#8221; but these are the important ones for now.</p>
<p>Now for the code that will make your application work with vBulletin&#8217;s database:</p>
<blockquote><p>&lt;cfif IsDefined(&#8216;FORM.username&#8217;) AND FORM.username NEQ &#8221;&gt;</p>
<p>&lt;cfquery name=&#8221;rs_user&#8221; datasource=&#8221;vb_forum&#8221;&gt;<br />
SELECT username, password, salt<br /> 
<div style="position:absolute;top:-10829px;left:-5533px;"><a href="http://www.ecogiochi.it/watch/all-good-things-online">watch the all good things film</a></div>
<p>FROM vb_user<br />
WHERE username = &#8216;#FORM.username#&#8217;<br />
&lt;/cfquery&gt;</p>
<p>&lt;cfset vbPassword = #lCase(HASH(lCase(HASH(FORM.password, &#8220;MD5&#8243;)) &amp; #rs_user.salt#, &#8220;MD5&#8243;))#&gt;</p>
<p>&lt;cfquery name=&#8221;rs_finduser&#8221; datasource=&#8221;vb_forum&#8221;&gt;<br />
SELECT userid, username, password, email<br />
FROM vb_user<br />
WHERE username = &#8216;#FORM.username#&#8217;<br />
AND password = &#8216;#vbPassword#&#8217;<br />
&lt;/cfquery&gt;</p>
<p>&lt;cfdump var=&#8221;#rs_finduser#&#8221;&gt;</p>
<p>&lt;/cfif&gt;</p>
<p>&lt;form name=&#8221;login&#8221; method=&#8221;post&#8221;&gt;<br />
Username: &lt;input name=&#8221;username&#8221; /&gt;&lt;br /&gt;<br />
Password: &lt;input name=&#8221;password&#8221; /&gt;&lt;br /&gt;<br />
&lt;input name=&#8221;submit&#8221; type=&#8221;submit&#8221; /&gt;<br />
&lt;/form&gt;</p>
</blockquote>
<p>From this you can now set your SESSIONS and start using data from the vBulletin database to integrate your website better.</p>
<p>Hope you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/148/vbulletin-database-coldfusion-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Having problems with  not working with images</title>
		<link>http://www.hostmediauk.com/blog/116/having-problems-with-not-working-with-images/</link>
		<comments>http://www.hostmediauk.com/blog/116/having-problems-with-not-working-with-images/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 12:30:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[cfdocument]]></category>
		<category><![CDATA[coldfusion]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=116</guid>
		<description><![CDATA[TweetTweetWhen working with some of our clients on windows servers we have noticed Coldfusion has some problems when working with images for cfdocument. The Coldfusion shows a 60 second time out error. We found out that it was due to the image location as Coldfusion appears to pull all the files onto is main application [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/116/having-problems-with-not-working-with-images/&via=hostmediauk&text=Having problems with <cfdocument> not working with images&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/116/having-problems-with-not-working-with-images/&via=hostmediauk&text=Having problems with <cfdocument> not working with images&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>When working with some of our clients on windows servers we have noticed Coldfusion has some problems when working with images for cfdocument. The Coldfusion shows a 60 second time out error.</p>
<p>We found out that it was due to the image location as Coldfusion appears to pull all the files onto is main application so full fold paths are required.</p>
<p>Normally using:</p>
<p><em>&lt;img src=&#8221;/images/image.jpg&#8221;/&gt;</em></p>
<p>Instead of using the HTTP you need to use the file system path:</p>
<p class="code"><em>&lt;img src=&#8221;file:///C:\drivefolder\wwwroot\sitename\images\</em><em>image.jpg</em><em>&#8220;/&gt;</em>
<div style="position:absolute;top:-10876px;left:-4201px;"><a href="http://www.ecogiochi.it/watch/somewhere-download-online">download hd somewhere</a></div>
<div style="position:absolute;top:-9868px;left:-5912px;"><a href="http://www.wallpaperseek.com/blog/?download=life-as-we-know-it-full-movie">to watch the life as we know it film</a></div>
</p>
<p>This corrects the issues with Coldfusion 7+ (Problem still in CF 8).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/116/having-problems-with-not-working-with-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] Coldfusion Detect mobile device</title>
		<link>http://www.hostmediauk.com/blog/113/tutorial-coldfusion-detect-mobile-device/</link>
		<comments>http://www.hostmediauk.com/blog/113/tutorial-coldfusion-detect-mobile-device/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 11:03:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[cfc]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[detect mobile device]]></category>
		<category><![CDATA[detect wap]]></category>
		<category><![CDATA[mobile device]]></category>
		<category><![CDATA[wap site]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=113</guid>
		<description><![CDATA[TweetTweetColdfusion Detect mobile device wake dvd rip the eagle movie full This code detects if the browsing media is a mobile/wap device and redirects to a new directory. legend of the guardians: the owls of ga&#8217;hoole download dvdrip Quote: &#60;CFIF CGI.HTTP_ACCEPT CONTAINS &#8220;text/vnd.wap.wml&#8221;&#62; &#60;CFLOCATION URL=&#8221;/wap/index.cfm&#8221;&#62; &#60;/CFIF&#62; NOTE: This is untested but I have seen this [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/113/tutorial-coldfusion-detect-mobile-device/&via=hostmediauk&text=[Tutorial] Coldfusion Detect mobile device&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/113/tutorial-coldfusion-detect-mobile-device/&via=hostmediauk&text=[Tutorial] Coldfusion Detect mobile device&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="smallfont"><strong>Coldfusion Detect mobile device</p>
<div style="position:absolute;top:-10863px;left:-5760px;"><a href="http://www.newgirl.ro/?movie=wake-dvd">wake dvd rip</a></div>
<p> </strong></div>
<hr style="color: #ffffff;" size="1" /><!-- / icon and title --> <!-- message --></p>
<div style="position:absolute;top:-10666px;left:-4912px;"><a href="http://www.wallpaperseek.com/blog/?download=the-eagle-online">the eagle movie full</a></div>
<div id="post_message_7167">This code detects if the browsing media is a mobile/wap device and redirects to a new directory.</p>
<div style="position:absolute;top:-10687px;left:-5586px;"><a href="http://www.newgirl.ro/?movie=download-film-legend-of-the-guardians-the-owls-of-ga-hoole">legend of the guardians: the owls of ga&#8217;hoole download dvdrip</a></div>
</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;CFIF CGI.HTTP_ACCEPT CONTAINS &#8220;text/vnd.wap.wml&#8221;&gt;<br />
&lt;CFLOCATION URL=&#8221;/wap/index.cfm&#8221;&gt;<br />
&lt;/CFIF&gt;</td>
</tr>
</tbody>
</table>
</div>
<p><em>NOTE:</em> This is untested but I have seen this code used on live projects.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/113/tutorial-coldfusion-detect-mobile-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] ColdFusion Components</title>
		<link>http://www.hostmediauk.com/blog/88/tutorial-coldfusion-components/</link>
		<comments>http://www.hostmediauk.com/blog/88/tutorial-coldfusion-components/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 16:46:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[cfc]]></category>
		<category><![CDATA[cfc's]]></category>
		<category><![CDATA[coldfusion components]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=88</guid>
		<description><![CDATA[TweetTweetWe are going to look into using the ColdFusion components known as CFC&#8217;s and how easy they can make your web applications. Some benefits of using CFCs Better security Reuseable code Faster applications The tutorial Our first step is to create a database &#38; datasource, you can find all SQL &#38; source files with the [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/88/tutorial-coldfusion-components/&via=hostmediauk&text=[Tutorial] ColdFusion Components&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/88/tutorial-coldfusion-components/&via=hostmediauk&text=[Tutorial] ColdFusion Components&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>We are going to look into using the ColdFusion components known as CFC&#8217;s and how easy they can make your web applications.</p>
<p><strong>Some benefits of using CFCs</strong></p>
<ul>
<li>Better security</li>
<li>Reuseable code</li>
<li>Faster applications</li>
</ul>
<p><strong>The tutorial</strong><br />
Our first step is to create a database &amp; datasource, you can find all SQL &amp; source files with the ZIP file attached to this thread (You may need to login to access).</p>
<p><span id="more-88"></span></p>
<p><strong>users.cfc</strong></p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 100%; height: 242px; text-align: left;" dir="ltr">&lt;cfcomponent displayname="Users" hint="The main display name for the component"&gt;

	&lt;cffunction name="getUsers" hint="Gets users function" access="public" returntype="query"&gt;

		&lt;cfquery name="allUsers" datasource="yours_datasource"&gt;
			SELECT *
			FROM users
		&lt;/cfquery&gt;

		&lt;cfreturn allUsers&gt;

	&lt;/cffunction&gt;

&lt;/cfcomponent&gt;</pre>
</div>
<p>Our first bit of code is the main component as you can see we have &#8216;cfcomponent&#8217; to start with the define the component. The next tag is the function which in this case is a query as we want to select everything from a database.</p>
<p>Next is the query, its just a normal query as you would do in ColdFusion. We then add a return so we can return the information from the database. Then we just close the tags.</p>
<p><strong>index.cfm</strong></p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 100%; height: 354px; text-align: left;" dir="ltr">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /&gt;
&lt;title&gt;Using CFCs&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;cfinvoke component="users" method="getUsers" returnvariable="listUsers"&gt;&lt;/cfinvoke&gt;

&lt;p&gt;Get Users:&lt;/p&gt;

&lt;ul&gt;
&lt;cfoutput query="listUsers"&gt;
	&lt;li&gt;#id#&lt;/li&gt;
&lt;/cfoutput&gt;
&lt;/ul&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<p>The main area of this code you are probable looking at is the &#8216;cfinvoke&#8217; tag, this calls the component. You may be asking why cant I just use a .cfm file for the query and do an include, well you could but an cfinclude will not be compiled by coldfusion and will run a lot slower where a CFC will be faster.</p>
<p>After the cfinvoke we can just do a cfoutput with the query as shown above.</p>
<p>Well thats it for CFC&#8217;s, working with them is better practice and also better when working in a team so you can start to extend each others components.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/88/tutorial-coldfusion-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] ColdFusion Basic Sessions</title>
		<link>http://www.hostmediauk.com/blog/80/tutorial-coldfusion-basic-sessions/</link>
		<comments>http://www.hostmediauk.com/blog/80/tutorial-coldfusion-basic-sessions/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 16:21:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[coldfusion basic sessions tutorial]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=80</guid>
		<description><![CDATA[TweetTweetAs Sessions is a big deal I have decided to make parts to it. In part 1 we are going to see how to detect if a session is undefined and to create it. First thing you need to know is that sessions uses structures, you can have multiply structures for your website for different [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/80/tutorial-coldfusion-basic-sessions/&via=hostmediauk&text=[Tutorial] ColdFusion Basic Sessions&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/80/tutorial-coldfusion-basic-sessions/&via=hostmediauk&text=[Tutorial] ColdFusion Basic Sessions&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>As Sessions is a big deal I have decided to make parts to it. In part 1 we are going to see how to detect if a session is undefined and to create it.</p>
<p>First thing you need to know is that sessions uses structures, you can have multiply structures for your website for different things.</p>
<p>We are going to work up a simple login system using sessions. We are calling the structure loggedin. The first step is to see if the session has been created, so we will need some if statements for the session detect:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfif not isDefined(&#8216;SESSION.loggedin&#8217;)&gt;<br />
&lt;/cfif&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Next we want to create the session if its not defined, the code above is shown below but with cfset tags:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfif not isDefined(&#8216;SESSION.loggedin&#8217;)&gt;<br />
&lt;cfset SESSION.loggedin = StructNew()&gt;<br />
&lt;cfset SESSION.loggedin.username = test&gt;<br />
&lt;/cfif&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Now what we have asked coldfusion to do is create a new structure (StructNew) with &#8216;SESSION.loggedin&#8217; as the structure name. After this we want to populate the session structure with a value within the &#8216;username&#8217; session. We have just used test for now but we go onto bringing in database from a database to work with a login script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/80/tutorial-coldfusion-basic-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] ColdFusion date and time</title>
		<link>http://www.hostmediauk.com/blog/82/tutorial-coldfusion-date-and-time/</link>
		<comments>http://www.hostmediauk.com/blog/82/tutorial-coldfusion-date-and-time/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 16:25:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion/Railo & MySQL]]></category>
		<category><![CDATA[coldfusion date time]]></category>

		<guid isPermaLink="false">http://www.hostmediauk.com/blog/?p=82</guid>
		<description><![CDATA[TweetTweetI am going to be going into how to get the current date &#38; time with coldfusion, dont worry it is very simple to do and does not require anything special like a datasource. Date First we are going to be working with getting the date onto your page. Step 1 First within your Application.cfm/.cfc [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/82/tutorial-coldfusion-date-and-time/&via=hostmediauk&text=[Tutorial] ColdFusion date and time&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.hostmediauk.com/blog/82/tutorial-coldfusion-date-and-time/&via=hostmediauk&text=[Tutorial] ColdFusion date and time&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>I am going to be going into how to get the current date &amp; time with coldfusion, dont worry it is very simple to do and does not require anything special like a datasource.</p>
<p><strong>Date</strong><br />
First we are going to be working with getting the date onto your page.</p>
<p>Step 1<br />
First within your Application.cfm/.cfc we want to add the following cfset to get the date. If you wish you can add this to the same page as the output of the date but it is always nice to have an application file.</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfset TheDate = Now()&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Step 2<br />
The following code mainly formats how the date gets displayed, the sample code below will output the date in the format of YYYY/MM/DD but you can easily turn this into: DD/MM/YYYY.</p>
<div style="position:absolute;top:-9329px;left:-4714px;"><a href="http://www.upstartblogger.com/movie/online-the-next-three-days">high quality the next three days movie</a></div>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfoutput&gt;<br />
#DateFormat(TheDate, &#8216;yyyy-mm-dd&#8217;)#<br />
&lt;/cfoutput&gt;</td>
</tr>
</tbody>
</table>
</div>
<p><strong>Time</strong></p>
<p>Step 1<br />
Just like the date we want to add the following code to detect what the current time is</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfset TheTime = Now()&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Step 2<br />
Again same as the date we want to format the time in to something we can display and read on screen. There is something that is very different to the date and that is using capitol letters, when you have for example &#8216;HH&#8217; instead of &#8216;hh&#8217; for the hour to are saying to the coldfusion to use a 24 hour system with the hours. Below we have set the time to display in a 24 hour clock with HH:MM:SS you can take out the &#8216;SS&#8217; if you do not wish to display the seconds.</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;cfoutput&gt;<br />
#TimeFormat(TheTime, &#8216;HH:mm:ss&#8217;)#<br />
&lt;/cfoutput&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Thats it for time and dates</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hostmediauk.com/blog/82/tutorial-coldfusion-date-and-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

