<?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>Random Web Tools &#187; Web Tools</title>
	<atom:link href="http://www.randomtools.net/category/web-tools/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randomtools.net</link>
	<description>Advice and tools from a young web developer</description>
	<lastBuildDate>Fri, 13 Jan 2012 01:08:01 +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>Automatically convert to and from Base64</title>
		<link>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html</link>
		<comments>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 06:16:11 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=170</guid>
		<description><![CDATA[I just finished a small, simple, yet interesting script for detecting whether code is base64 and encoding or decoding it based on the result. Let&#39;s be honest, PHP made it super easy for me with the base64_encode() and base64_decode() functions. I just wrapped it up in what I think is a pretty handy little tool [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished a small, simple, yet interesting script for detecting whether code is base64 and encoding or decoding it based on the result. Let&#39;s be honest, PHP made it super easy for me with the base64_encode() and base64_decode() functions. I just wrapped it up in what I think is a pretty handy little tool that I know at least one person will get some use out of!</p>
<p>Try it out: <a href="http://www.base64converter.com/">Base64 Converter</a></p>
<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View HTTP Response Headers</title>
		<link>http://www.randomtools.net/view-http-response-headers-175.html</link>
		<comments>http://www.randomtools.net/view-http-response-headers-175.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 06:15:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=175</guid>
		<description><![CDATA[Just a quick note to share a site I found that comes in handy when needing to debug web troubles. You can use the site to handily view HTTP request and HTTP response headers to see exactly what&#39;s going on behind the scenes. Web Sniffer To be totally honest, I&#8217;ll probably end up creating my [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to share a site I found that comes in handy when needing to debug web troubles. You can use the site to handily view HTTP request and HTTP response headers to see exactly what&#39;s going on behind the scenes.</p>
<p><a href="http://web-sniffer.net/" target="_blank" rel="nofollow">Web Sniffer</a></p>
<p>To be totally honest, I&#8217;ll probably end up creating my own site for this because I like to build things out for the fun of it.</p>
<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/view-http-response-headers-175.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/view-http-response-headers-175.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to view where DNS has propagated all over the world</title>
		<link>http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html</link>
		<comments>http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 20:44:49 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[SEO Tools]]></category>
		<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=155</guid>
		<description><![CDATA[I just wanted to quickly share a nice tool that I use all of the time when transferring sites to different servers or just changing DNS entries. Sometimes it&#39;s hard to tell how long or if the DNS for your domain has updated in other regions in the world. In this case, I use WhatsMyDns.net. [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to quickly share a nice tool that I use all of the time when transferring sites to different servers or just changing DNS entries. Sometimes it&#39;s hard to tell how long or if the DNS for your domain has updated in other regions in the world. In this case, I use <a href="http://www.whatsmydns.net" target="_blank" rel="nofollow">WhatsMyDns.net</a>. It&#39;s a neat tool that allows you to look up the current DNS listing for common entries (I really only ever need to use A or CNAME) in quite a few servers located around the world. Since DNS propagates differently by geographic region, this tool is a very good overview as to how users are accessing your site.</p>
<p>Also, if you&#39;re like me and constantly need to check your IP address and don&#39;t want to always search google for &quot;<a href="http://www.whatsmyinfo.com" target="_blank">whats is my ip</a>&quot;, I&#39;d recommend you bookmark <a href="http://www.whatsmyinfo.com" target="_blank">whats my info</a>, a simple, non-bloated site that gives you what just you&#39;re looking for.</p>
<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html&amp;title=How to view where DNS has propagated all over the world' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-view-where-dns-has-propagated-all-over-the-world-155.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cloud Hosting Providers</title>
		<link>http://www.randomtools.net/cloud-hosting-providers-65.html</link>
		<comments>http://www.randomtools.net/cloud-hosting-providers-65.html#comments</comments>
		<pubDate>Thu, 27 Aug 2009 20:16:40 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=65</guid>
		<description><![CDATA[I&#8217;ve had some experience trying out different cloud hosts and I&#8217;d just like to make a list of providers here: Bookmark this page]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had some experience trying out different cloud hosts and I&#8217;d just like to make a list of providers here:</p>
<p align="center"><a style="text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align: center; display: block;" href="http://www.rackspacecloud.com"><img alt="Powered by Rackspace Cloud Computing" border="0" src="http://cdn.cloudfiles.mosso.com/c110782/the-rackspace-cloud-250-wide.png" /></a></p>
<p align="center"><a rel="nofollow" target="_blank" href="http://www.gogrid.com/"><img alt="GoGrid Hosting" src="http://img.photobucket.com/albums/v488/baseballdude_03/logo_gogrid.gif" /></a></p>
<p align="center"><a rel="nofollow" target="_blank" href="http://aws.amazon.com/"><img alt="Amazon Web Services" src="http://img.photobucket.com/albums/v488/baseballdude_03/logo_aws.gif" /></a></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/cloud-hosting-providers-65.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/cloud-hosting-providers-65.html&amp;title=Cloud Hosting Providers' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/cloud-hosting-providers-65.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP File-System Cache</title>
		<link>http://www.randomtools.net/php-file-system-cache-58.html</link>
		<comments>http://www.randomtools.net/php-file-system-cache-58.html#comments</comments>
		<pubDate>Tue, 25 Aug 2009 00:22:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=58</guid>
		<description><![CDATA[I&#8217;m just sharing a couple of functions I created a while back to cache some resource-intensive processed dada for quick and easy access. This is pretty ideal for large amounts of data and it&#8217;s very simple to set up. The beauty of this is that you can store just about any data type &#8211; it [...]]]></description>
			<content:encoded><![CDATA[<div style="width: 300px; height: 250px; margin: 5px; float: right;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<p>I&#8217;m just sharing a couple of functions I created a while back to cache some resource-intensive processed dada for quick and easy access. This is pretty ideal for large amounts of data and it&#8217;s very simple to set up. The beauty of this is that you can store just about any data type &#8211; it doesn&#8217;t have to be a string.</p>
<p>Just setup the cache directory to have proper read/write permissions (preferably in a non-accessible from web directory). Then use the two functions.</p>
<p style="clear: both;"><strong>Example usage:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// The 2nd argument, $hours is how long to retain data before getting new</span>
<span style="color: #000088;">$contents</span> <span style="color: #339933;">=</span> get_cache<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TEST_KEY'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$contents</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// This is where you'd get data from an API, DB or whatever</span>
	<span style="color: #000088;">$contents</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Just some example contents'</span><span style="color: #339933;">;</span>
	set_cache<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TEST_KEY'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$contents</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$contents</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CACHE_DIR'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Include trailing slash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_cache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hours</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> CACHE_DIR <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.cache'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$hours</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> set_cache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> CACHE_DIR <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.cache'</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">file_put_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/php-file-system-cache-58.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/php-file-system-cache-58.html&amp;title=PHP File-System Cache' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/php-file-system-cache-58.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP File_Get_Contents and File_Put_Contents</title>
		<link>http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html</link>
		<comments>http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:20:10 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[asp]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=36</guid>
		<description><![CDATA[As I&#39;ve become more of a PHP developer than an ASP developer, one thing I&#39;ve noticed is that it is 10x easier to read/write text files with PHP. Simple use file_get_contents() and be done. ASP isn&#39;t so nice. But it can be done, so I&#39;m creating those for simplicity here: Of course this file_get_contents doesn&#39;t [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#39;ve become more of a PHP developer than an ASP developer, one thing I&#39;ve noticed is that it is 10x easier to read/write text files with PHP. Simple use file_get_contents() and be done. ASP isn&#39;t so nice. But it can be done, so I&#39;m creating those for simplicity here:</p>
<pre class="brush: vb"><%
Function File_Get_Contents(strFile)
	' Remote File
	If Left(strFile, 7) = "http://" Or Left(strFile, 8) = "https://" Then
		Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
		' Use this line if above errors
		'Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
		objXML.Open "GET", strFile, False
		objXML.Send()
		File_Get_Contents = objXML.ResponseText()
		Set objXML = Nothing
	' Local File
	Else
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		Set objFile = objFSO.OpenTextFile(strFile, 1)
		File_Get_Contents = objFile.ReadAll()
		Set objFile = Nothing
		Set objFSO = Nothing
	End If
End Function

Function File_Put_Contents(strFile, strContents, blnAppend)
	If blnAppend Then
		intMode = 8
	Else
		intMode = 2
	End If
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	Set objFile = objFSO.OpenTextFile(strFile, intMode, True)
	objFile.Write(strContents)
	Set objFile = Nothing
	Set objFSO = Nothing
End Function
%></pre>
<p>Of course this file_get_contents doesn&#39;t support remote URLs, but it can easily be added.</p>
<p>EDIT: I just added remote URL support.</p>
<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html&amp;title=ASP File_Get_Contents and File_Put_Contents' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/asp-file_get_contents-and-file_put_contents-36.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Useful SEO tools, etc.</title>
		<link>http://www.randomtools.net/useful-seo-tools-etc-4.html</link>
		<comments>http://www.randomtools.net/useful-seo-tools-etc-4.html#comments</comments>
		<pubDate>Mon, 12 May 2008 18:19:18 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[SEO Tools]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[domain tools]]></category>
		<category><![CDATA[domain valuation]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=4</guid>
		<description><![CDATA[I consider myself somewhat of a domainer, so I&#8217;m always trying to keep a good overall look over the industry so I know what&#8217;s going to happen before others do. When I find domains or sites I might be interested in, I typically do some quick research on them. I also like to keep a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://estibot.com/pro/go.php?r=403&amp;i=b0" target="_blank"><img class="alignright" style="float: right;" src="http://estibot.com/uplogo.jpg" alt="Estibot Logo" width="319" height="62" /></a>I consider myself somewhat of a domainer, so I&#8217;m always trying to keep a good overall look over the industry so I know what&#8217;s going to happen before others do.  When I find domains or sites I might be interested in, I typically do some quick research on them.  I also like to keep a good handle on the statistics for my sites and how their keywords are operating.</p>
<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<p>The following is a list of random web tools I use nearly on a day-to-day basis in no particular order.</p>
<ul>
<li><a href="http://estibot.com/pro/go.php?r=403&amp;i=b0" target="_blank">Estibot</a>
<ul>
<li>This is a nice tool for evaluating the potential value of a domain.  It uses several techniques including keyword value and frequency, domain length, TLD (top-level-domain) value, domain registration length, Google PageRank, etc. to produce a handy (generally somewhat realistic) domain valuation.  Keep in mind that a domain or site is always worth what someone is willing to pay for it, so make sure you do far more research than just this.</li>
</ul>
</li>
<li><a href="http://www.dnscoop.com" target="_blank">DNScoop</a>
<ul>
<li>This tool is very similar to estibot, except that it uses a slightly different algorithm to determine the valuation and has a slightly nicer interface, though Estibot is faster.</li>
</ul>
</li>
<li><a href="http://www.nameboy.com" target="_blank">Nameboy</a>
<ul>
<li>Again, this tool is similar to the other two.  I would use it more, but it delivers the results via email which sometimes can take a while and be a pain.  Oh well, it&#8217;s still <strong>free</strong>!</li>
</ul>
</li>
<li><a href="http://www.dopedomains.com" target="_blank">Dope Domains</a>
<ul>
<li>This site has a very simple idea to it.  It automatically spiders sites like <a href="http://www.tdnam.com" target="_blank">TDNAM</a> (GoDaddy&#8217;s domain after-market) and <a href="http://www.sedo.com" target="_blank">Sedo</a> for the latest and greatest expiring domains.  The filters are nice so that you are able to spot out domains you&#8217;re interested in by TLD and/or categories like domains with traffic, short domains, dictionary domains, etc.</li>
</ul>
</li>
<li><a href="http://forums.digitalpoint.com" target="_blank">DigitalPoint Forums</a>
<ul>
<li>This site is a very large, active community with a small proportion of helpful people.  They will give you their insight on the good, the bad, and the ugly of your domains and sites (sometimes whether you want it or not).  It&#8217;s also a good place to buy and sell domains, sites, and services.</li>
</ul>
</li>
<li><a href="http://www.namepros.com" target="_blank">NamePros Forums</a>
<ul>
<li>This site is very similar to DP (DigitalPoint).  I have lost interest in it because it seems to be less active and people seem less helpful.</li>
</ul>
</li>
</ul>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/useful-seo-tools-etc-4.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/useful-seo-tools-etc-4.html&amp;title=Useful SEO tools, etc.' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/useful-seo-tools-etc-4.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Freelance &#8220;time card&#8221; calculator</title>
		<link>http://www.randomtools.net/freelance-time-card-calculator-3.html</link>
		<comments>http://www.randomtools.net/freelance-time-card-calculator-3.html#comments</comments>
		<pubDate>Mon, 12 May 2008 07:53:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[freelance]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=3</guid>
		<description><![CDATA[I don&#8217;t know how many others will find this handy, but I&#8217;ve found it handy myself. It&#8217;s tools like this that make this site &#8220;Random Web Tools.&#8221; The script is very simple. I just basically created a format for logging the time you work in a text file, so that you can copy and paste [...]]]></description>
			<content:encoded><![CDATA[<p><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>I don&#8217;t know how many others will find this handy, but I&#8217;ve found it handy myself.  It&#8217;s tools like this that make this site &#8220;Random Web Tools.&#8221; <img src='http://www.randomtools.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The script is very simple.  I just basically created a format for logging the time you work in a text file, so that you can copy and paste in your &#8220;time card&#8221; and it will spit out your total time worked.  The script could easily be modified to your liking.  I threw up an example <a href="http://www.randomtools.net/scripts/times.php">here</a>.  I originally wrote the script and also ported it to PHP.</p>
<p>Enter the times in the following format, separated by new lines or whatever. Whitespace does not matter.  The number in the parenthesis is what counts.  That&#8217;s the total hours:minutes worked during that period of work.  The script could be improved by just counting up from the times themselves, but there are lots of problems that could run into unless you included dates, and for personal reasons, I chose not to do that.  Don&#8217;t forget to change the hourly_rate variable if you want it to tell you how much you get owed.</p>
<pre>1:27 PM - 2:08 PM		(0:41)
12:09 AM - 1:12 AM		(1:03)</pre>
<p><strong>Demo: </strong><a href="http://www.randomtools.net/scripts/times.php" target="_blank">http://www.randomtools.net/scripts/times.php</a></p>
<p><strong>HTML form:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Enter the times, separated by new lines or whatever. Whitespace does not matter.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;times&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 300px; height: 200px;&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span>&gt;</span>Go<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></td></tr></table></div>

<p><strong>PHP source code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$hourly_rate</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Change this to your wage</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'POST'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$arr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'times'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'('</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pos</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$pos2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">')'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos2</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'('</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$x</span><span style="color: #339933;">++;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$hours</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$minutes</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$arr2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$minutes</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$arr2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$minutes</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$hours</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hours</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$minutes</span> <span style="color: #339933;">-=</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$hours</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$arr2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hours</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">15</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$minutes</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">60</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;Worked &lt;b&gt;<span style="color: #006699; font-weight: bold;">$hours</span> hours&lt;/b&gt; and &lt;b&gt;<span style="color: #006699; font-weight: bold;">$minutes</span> minutes&lt;/b&gt; (&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">number_format</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hours</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$minutes</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;)&lt;br /&gt;That's $&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">number_format</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hours</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$minutes</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$hourly_rate</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>ASP source code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;%</span>
hourly_rate <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">30</span> <span style="color: #008000;">'Change this to your wage</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">ServerVariables</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;REQUEST_METHOD&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;POST&quot;</span> <span style="color: #990099; font-weight: bold;">Then</span>
	<span style="color: #990099; font-weight: bold;">ReDim</span> arr<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">0</span><span style="color: #006600; font-weight:bold;">&#41;</span>
	x <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span>
	str <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Request</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;times&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
	pos <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span>str, <span style="color: #cc0000;">&quot;(&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
	<span style="color: #990099; font-weight: bold;">While</span> pos <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span>
		<span style="color: #990099; font-weight: bold;">ReDim</span> <span style="color: #990099; font-weight: bold;">Preserve</span> arr<span style="color: #006600; font-weight:bold;">&#40;</span>x<span style="color: #006600; font-weight:bold;">&#41;</span>
		pos2 <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span>str, <span style="color: #cc0000;">&quot;)&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		arr<span style="color: #006600; font-weight:bold;">&#40;</span>x<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">=</span> Mid<span style="color: #006600; font-weight:bold;">&#40;</span>str, pos + <span style="color: #800000;">1</span>, pos2 - pos - <span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		str <span style="color: #006600; font-weight: bold;">=</span> Mid<span style="color: #006600; font-weight:bold;">&#40;</span>str, pos2 + <span style="color: #800000;">2</span>, <span style="color: #330066;">Len</span><span style="color: #006600; font-weight:bold;">&#40;</span>str<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		pos <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span>str, <span style="color: #cc0000;">&quot;(&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		x <span style="color: #006600; font-weight: bold;">=</span> x + <span style="color: #800000;">1</span>
	<span style="color: #990099; font-weight: bold;">Wend</span>
&nbsp;
	hours <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span>
	minutes <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">For</span> x <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span> <span style="color: #990099; font-weight: bold;">To</span> <span style="color: #330066;">UBound</span><span style="color: #006600; font-weight:bold;">&#40;</span>arr<span style="color: #006600; font-weight:bold;">&#41;</span>
		arr2 <span style="color: #006600; font-weight: bold;">=</span> Split<span style="color: #006600; font-weight:bold;">&#40;</span>arr<span style="color: #006600; font-weight:bold;">&#40;</span>x<span style="color: #006600; font-weight:bold;">&#41;</span>, <span style="color: #cc0000;">&quot;:&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
		minutes <span style="color: #006600; font-weight: bold;">=</span> minutes + <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>arr2<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">If</span> minutes <span style="color: #006600; font-weight: bold;">&gt;=</span> <span style="color: #800000;">60</span> <span style="color: #990099; font-weight: bold;">Then</span>
			hours <span style="color: #006600; font-weight: bold;">=</span> hours + <span style="color: #800000;">1</span>
			minutes <span style="color: #006600; font-weight: bold;">=</span> minutes - <span style="color: #800000;">60</span>
		<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
		hours <span style="color: #006600; font-weight: bold;">=</span> hours + <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>arr2<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">0</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
	<span style="color: #990099; font-weight: bold;">Next</span>
&nbsp;
	total <span style="color: #006600; font-weight: bold;">=</span> hours <span style="color: #006600; font-weight: bold;">*</span> <span style="color: #800000;">15</span> + minutes <span style="color: #006600; font-weight: bold;">/</span> <span style="color: #800000;">60</span> <span style="color: #006600; font-weight: bold;">*</span> <span style="color: #800000;">15</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;&lt;p&gt;Worked &lt;b&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> hours <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot; hours&lt;/b&gt; and &lt;b&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> minutes <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot; minutes&lt;/b&gt; (&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> FormatNumber<span style="color: #006600; font-weight:bold;">&#40;</span>hours + minutes <span style="color: #006600; font-weight: bold;">/</span> <span style="color: #800000;">60</span>, <span style="color: #800000;">2</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;)&lt;br /&gt;That's &quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> FormatCurrency<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#40;</span>hours + minutes <span style="color: #006600; font-weight: bold;">/</span> <span style="color: #800000;">60</span><span style="color: #006600; font-weight:bold;">&#41;</span>, <span style="color: #800000;">2</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&lt;/p&gt;&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/freelance-time-card-calculator-3.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/freelance-time-card-calculator-3.html&amp;title=Freelance &#8220;time card&#8221; calculator' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/freelance-time-card-calculator-3.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

