<?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>Digital Epiphany Blog</title>
	<atom:link href="http://www.digital-epiphany-designs.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digital-epiphany-designs.com/blog</link>
	<description>Blog for coding examples and projects.</description>
	<lastBuildDate>Wed, 12 Oct 2011 18:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Prevent Spam without Captcha</title>
		<link>http://www.digital-epiphany-designs.com/blog/prevent-spam-without-captcha</link>
		<comments>http://www.digital-epiphany-designs.com/blog/prevent-spam-without-captcha#comments</comments>
		<pubDate>Mon, 10 May 2010 23:13:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[The Coding World]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=112</guid>
		<description><![CDATA[The following will show you how to prevent spam without the use of those annoying captcha images. I use javascript, which according to W3C, approximately 95% of the people browsing the web have it enabled. The odds of one of your visitors having it disabled is slim. If it does concern you however, you could [...]]]></description>
			<content:encoded><![CDATA[<p>The following will show you how to prevent spam without the use of those annoying captcha images. I use javascript, which according to W3C, approximately 95% of the people browsing the web have it enabled. The odds of one of your visitors having it disabled is slim. If it does concern you however, you could always place a notice to turn on javascript before using the form or you could always use another method, just place the other method in &lt;noscript&gt; &lt;/noscript&gt; tags.</p>
<p>Below is how you could prevent spam with simple javascript.</p>
<p><strong>TESTED IN THE LATEST BROWSERS: Internet Explorer 8.x, Firefox 3.x, Chrome 4.x, Safari 4.x</strong></p>
<p>&nbsp;</p>
<p><strong>Step 1:</strong> Create a separate javascript file and link to it in the &lt;head&gt; section of your page. I will call my file &#8220;formvalidation.js&#8221; and I will link to it from my form page &#8220;form.html&#8221;.</p>
<p> Example of the &#8220;head&#8221; section of &#8220;form.html&#8221;:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code9'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1129"><td class="code" id="p112code9"><pre class="html" style="font-family:monospace;">  &lt;head&gt;
    &lt;script language=&quot;JavaScript&quot; src=&quot;formvalidation.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
  &lt;/head&gt;
  &lt;body&gt;
  Your form would be here.
  &lt;/body&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 2:</strong> Remove the form&#8217;s <em>action=&#8221;"</em> attribute</p>
<p>    Some Spam bots will submit directly to the form&#8217;s source, this step prevents that.</p>
<p>    Example of the form&#8217;s attributes:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code10'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11210"><td class="code" id="p112code10"><pre class="html" style="font-family:monospace;">&nbsp;
  &lt;form name=&quot;exampleform&quot; method=&quot;POST&quot; id=&quot;exampleform&quot;&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 3:</strong> Add some simple requirements to our form. I will use first name and last name.</p>
<p>Example:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code11'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11211"><td class="code" id="p112code11"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;hidden&quot; id=&quot;req_id&quot; name=&quot;req_id[]&quot; value=&quot;first_name&quot;&gt;
&lt;input type=&quot;hidden&quot; id=&quot;req_id&quot; name=&quot;req_id[]&quot; value=&quot;last_name&quot;&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 4:</strong> Add a hidden field called &#8220;human&#8221; and set its value to &#8220;0&#8243;. We will change this value once we determine a human is filling out the form.</p>
<p>Example:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code12'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11212"><td class="code" id="p112code12"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;hidden&quot; id=&quot;human&quot; name=&quot;human&quot; value=&quot;0&quot;&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 5:</strong> On one of your required fields, add a javascript function to call once something is typed into it. This verifies that a human is filling out the form. I will place it on the &#8220;Last Name&#8221; field.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code13'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11213"><td class="code" id="p112code13"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;text&quot; name=&quot;last_name&quot; id=&quot;last_name&quot; onchange=&quot;validateHuman('exampleform');&quot; /&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 6:</strong> Make the form submit button execute a javascript function that will check all the required fields, verify that a human submitted the form, and then submit the form for processing.</p>
<p>Example:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code14'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11214"><td class="code" id="p112code14"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;button&quot; name=&quot;Submit&quot; value=&quot;Submit&quot; onclick=&quot;submitForm('exampleform');&quot; /&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Step 7:</strong> Add the following Javascript to your Javascript file &#8220;formvalidation.js&#8221;. These two javascript functions, &#8220;validateHuman&#8221; and &#8220;submitForm&#8221; will do all the work of preventing spam.</p>
<p><strong>validateHuman</strong> &#8211; changes the &#8220;human&#8221; form element to another number once a person has typed into your required field.<br />
<strong><br />
submitForm</strong> &#8211; validates the required form elements have been filled in, checks to see the value of &#8220;human&#8221; has changed, and then submits the form for processing.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code15'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11215"><td class="code" id="p112code15"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> submitForm<span style="color: #009900;">&#40;</span>frm<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//Check is the visitor's browser supports the javascript function</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//START function executed</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">//we will now check to see if all required fields were filled in</span>
    <span style="color: #003366; font-weight: bold;">var</span> error <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'req_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">||</span> document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'req_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//store all of the required fields into &quot;reqs&quot;</span>
		<span style="color: #003366; font-weight: bold;">var</span> reqs<span style="color: #339933;">=</span>document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'req_id[]'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//count the number of required fields</span>
		<span style="color: #003366; font-weight: bold;">var</span> nbr_fields <span style="color: #339933;">=</span> reqs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//set a variable &quot;req&quot; to make sure all the &quot;reqs&quot; stay true</span>
		<span style="color: #003366; font-weight: bold;">var</span> req <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">//loop through all the required fields, making sure they are not blank</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>nbr_fields<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span>reqs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		   <span style="color: #006600; font-style: italic;">//the field is blank</span>
		   req <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		   <span style="color: #006600; font-style: italic;">//list what field has been left blank to inform the user</span>
		   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>reqs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'first_name'</span><span style="color: #009900;">&#41;</span> error <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> - First Name&quot;</span><span style="color: #339933;">;</span>
		   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>reqs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'last_name'</span><span style="color: #009900;">&#41;</span> error <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> - Last Name&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">//if all required fields are filled in</span>
		<span style="color: #006600; font-style: italic;">//and the &quot;human&quot; form element has changed</span>
		<span style="color: #006600; font-style: italic;">//submit the form</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>req<span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">&amp;&amp;</span> document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'human'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'42'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">action</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://somewebsite.com/submit.php&quot;</span><span style="color: #339933;">;</span>
			document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Opps, it looks like some fields are blank:<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">+</span>error<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span>
     <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">//END function executed</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> 
    <span style="color: #006600; font-style: italic;">//START the browser does not support the function</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Your browser lacks the capabilities required to run this script!<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>Please call 555-555-5555 and we will gladly take your information over the phone.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">//END the browser does not support the function</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validateHuman<span style="color: #009900;">&#40;</span>frm<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>frm<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'human'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;42&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s it! Your form should now prevent spam bots from submitting directly to it. Below is just a total picture of how &#8220;form.html&#8221; will look according to this demo.</p>
<p>Example of form.html:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p112code16'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p11216"><td class="code" id="p112code16"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Example Form&lt;/title&gt;
&lt;script language=&quot;JavaScript&quot; src=&quot;formvalidation.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
&lt;form name=&quot;exampleform&quot; id=&quot;exampleform&quot; action=&quot;submit.php&quot; method=&quot;POST&quot;&gt;
&lt;input type=&quot;hidden&quot; id=&quot;req_id&quot; name=&quot;req_id[]&quot; value=&quot;first_name&quot;&gt;
&lt;input type=&quot;hidden&quot; id=&quot;req_id&quot; name=&quot;req_id[]&quot; value=&quot;last_name&quot;&gt;
&lt;input type=&quot;hidden&quot; id=&quot;human&quot; name=&quot;human&quot; value=&quot;0&quot;&gt;
First Name: &lt;input type=&quot;text&quot; name=&quot;first_name&quot; id=&quot;first_name&quot; /&gt;&lt;br /&gt;
Last Name: &lt;input type=&quot;text&quot; name=&quot;last_name&quot; id=&quot;last_name&quot; onchange=&quot;validateHuman('exampleform');&quot; /&gt;&lt;br /&gt;
&lt;input type=&quot;button&quot; name=&quot;Submit&quot; value=&quot;Submit&quot; onclick=&quot;submit_form('exampleform');&quot; /&gt;
&lt;/form&gt;
&nbsp;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/prevent-spam-without-captcha/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Apps Free Standard Account</title>
		<link>http://www.digital-epiphany-designs.com/blog/google-apps-free-standard-account</link>
		<comments>http://www.digital-epiphany-designs.com/blog/google-apps-free-standard-account#comments</comments>
		<pubDate>Fri, 16 Apr 2010 13:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[standard]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=109</guid>
		<description><![CDATA[A number of times now I have had to relocate the link to set up google apps standard or google apps basic (the free version of google apps) on a few domains. So I figured I would post the link here to save me in my searching. I&#8217;m sure it may be helpful to others [...]]]></description>
			<content:encoded><![CDATA[<p>A number of times now I have had to relocate the link to set up <strong>google apps standard</strong> or <strong>google apps basic</strong> (the free version of google apps) on a few domains. So I figured I would post the link here to save me in my searching. I&#8217;m sure it may be helpful to others as well.</p>
<p>Google Apps Standard: <a href="http://www.google.com/apps/intl/en/group/index.html">http://www.google.com/apps/intl/en/group/index.html</a></p>
<p>Whenever I go to the Google Apps site I always find the premier edition no problem, they hid the free version link real well. Sneaky little googlers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/google-apps-free-standard-account/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use PHP to proportionally scale an image</title>
		<link>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image</link>
		<comments>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:06:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=106</guid>
		<description><![CDATA[I wrote the following function to proportionally scale images that I was pulling from a directory. View Code PHP&#160; function img_size&#40;$img,$alt&#41; &#123; &#160; list&#40;$width,$height&#41; = getimagesize&#40;$img&#41;; &#160; $maxwidth = 140; //set max width here &#160; if &#40;$width &#62; $maxwidth&#41; &#123; $i = $width - $maxwidth; $x = $width - $i; $percent = $maxwidth/$width; &#125; else [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote the following function to proportionally scale images that I was pulling from a directory.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p106code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10618"><td class="code" id="p106code18"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> img_size<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span><span style="color: #000088;">$alt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span><span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$maxwidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//set max width here</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$maxwidth</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$maxwidth</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$percent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$maxwidth</span><span style="color: #339933;">/</span><span style="color: #000088;">$width</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">else</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$percent</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$y</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$percent</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$height</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$img_src</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$img</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$y</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; alt=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; border=&quot;0&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$img_src</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> img_size<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://somesite.com/image.jpg'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'some alt text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//result &lt;img src=&quot;http://somesite.com/image.jpg&quot; width=&quot;140&quot; height=&quot;(proportionate to 140)&quot; alt=&quot;(alt)&quot; border=&quot;0&quot;&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL, UPDATE data into a database using CONCAT()</title>
		<link>http://www.digital-epiphany-designs.com/blog/mysql-update-data-into-a-database-using-concat</link>
		<comments>http://www.digital-epiphany-designs.com/blog/mysql-update-data-into-a-database-using-concat#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:46:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=101</guid>
		<description><![CDATA[To insert data into a MySQL database while preserving the already existing data, you will just concatenate your new data to the end of your existing data. Below is an example of how to do it using the column &#8220;changelog&#8221; which is used to keep track of changes made to the row/record. View Code MYSQLUPDATE [...]]]></description>
			<content:encoded><![CDATA[<p>To insert data into a MySQL database while preserving the already existing data, you will just concatenate your new data to the end of your existing data.</p>
<p>Below is an example of how to do it using the column &#8220;changelog&#8221; which is used to keep track of changes made to the row/record.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code21'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10121"><td class="code" id="p101code21"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> table1 <span style="color: #990099; font-weight: bold;">SET</span> changelog<span style="color: #CC0099;">=</span><span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span>changelog<span style="color: #000033;">,</span><span style="color: #008000;">&quot;new data&quot;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">WHERE</span> id<span style="color: #CC0099;">=</span><span style="color: #008000;">'idnumber'</span></pre></td></tr></table></div>

<p>
If you would like the data that you are entering to appear at the beginning of the existing data, simply flip the concatenation, example:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code22'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10122"><td class="code" id="p101code22"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> table1 <span style="color: #990099; font-weight: bold;">SET</span> changelog<span style="color: #CC0099;">=</span><span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">&quot;new data&quot;</span><span style="color: #000033;">,</span>changelog<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">WHERE</span> id<span style="color: #CC0099;">=</span><span style="color: #008000;">'idnumber'</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/mysql-update-data-into-a-database-using-concat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL DELETE with a Max() Subquery</title>
		<link>http://www.digital-epiphany-designs.com/blog/mysql-delete-with-a-max-subquery</link>
		<comments>http://www.digital-epiphany-designs.com/blog/mysql-delete-with-a-max-subquery#comments</comments>
		<pubDate>Tue, 03 Nov 2009 20:50:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=98</guid>
		<description><![CDATA[Here is another nifty way to use a Subquery when deleting a record from your MySQL table. View Code MYSQLDELETE FROM table1 WHERE id = '1' &#38;&#38; saleid='345' &#38;&#38; slot = &#40;SELECT MAX&#40;slot&#41; FROM table1&#41;]]></description>
			<content:encoded><![CDATA[<p>Here is another nifty way to use a Subquery when deleting a record from your MySQL table.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p98code24'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9824"><td class="code" id="p98code24"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">DELETE</span> <span style="color: #990099; font-weight: bold;">FROM</span> table1 <span style="color: #990099; font-weight: bold;">WHERE</span> id <span style="color: #CC0099;">=</span> <span style="color: #008000;">'1'</span> <span style="color: #CC0099;">&amp;&amp;</span> saleid<span style="color: #CC0099;">=</span><span style="color: #008000;">'345'</span> 
	                  <span style="color: #CC0099;">&amp;&amp;</span> slot <span style="color: #CC0099;">=</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">MAX</span><span style="color: #FF00FF;">&#40;</span>slot<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">FROM</span> table1<span style="color: #FF00FF;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/mysql-delete-with-a-max-subquery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL INSERT with a Max()+1 Subquery</title>
		<link>http://www.digital-epiphany-designs.com/blog/mysql-insert-with-a-max1-subquery</link>
		<comments>http://www.digital-epiphany-designs.com/blog/mysql-insert-with-a-max1-subquery#comments</comments>
		<pubDate>Tue, 03 Nov 2009 20:47:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=93</guid>
		<description><![CDATA[This was a pain in my ass to figure out so I figured I would post it here in case anyone else needs to insert a record using a Max()+1 Subquery. I only use the Max()+1 Subquery when the value you want to increase is not the primary key. View Code MYSQLINSERT INTO table &#40;row1, [...]]]></description>
			<content:encoded><![CDATA[<p>This was a pain in my ass to figure out so I figured I would post it here in case anyone else needs to insert a record using a Max()+1 Subquery.</p>
<p>I only use the Max()+1 Subquery when the value you want to increase is not the primary key.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p93code26'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9326"><td class="code" id="p93code26"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> <span style="color: #990099; font-weight: bold;">table</span> <span style="color: #FF00FF;">&#40;</span>row1<span style="color: #000033;">,</span> row2<span style="color: #000033;">,</span> row3<span style="color: #FF00FF;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #008080;">1</span> <span style="color: #CC0099;">+</span> <span style="color: #000099;">COALESCE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">MAX</span><span style="color: #FF00FF;">&#40;</span>row1<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #990099; font-weight: bold;">table</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #008000;">'value2'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'value3'</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/mysql-insert-with-a-max1-subquery/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Latitude and Longitude of a location using Javascript and Google</title>
		<link>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-javascript-and-google</link>
		<comments>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-javascript-and-google#comments</comments>
		<pubDate>Thu, 22 Oct 2009 18:54:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=86</guid>
		<description><![CDATA[The following Javascript will help you acquire the latitude and longitude of a location (using an address, zip code, or city). Note: You will need to have a Google API key which is domain specific. Place the following code in the &#60;head&#62; section: View Code JAVASCRIPTvar geocoder; geocoder = new GClientGeocoder&#40;&#41;; &#160; function submitForm&#40;&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>The following Javascript will help you acquire the latitude and longitude of a location (using an address, zip code, or city).</p>
<p>Note: You will need to have a <a href="http://code.google.com/apis/maps/signup.html" target="_blank">Google API key</a> which is domain specific.</p>
<p>Place the following code in the &lt;head&gt; section:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p86code29'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p8629"><td class="code" id="p86code29"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> geocoder<span style="color: #339933;">;</span>
geocoder <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GClientGeocoder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> submitForm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> address <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;address&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;city&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;state&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;zip&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
  geocoder.<span style="color: #660066;">getLocations</span><span style="color: #009900;">&#40;</span>address<span style="color: #339933;">,</span> getCoords<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getCoords<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>response <span style="color: #339933;">||</span> response.<span style="color: #000066;">Status</span>.<span style="color: #660066;">code</span> <span style="color: #339933;">!=</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Unable to Create Lat and Lng for plotting.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    place <span style="color: #339933;">=</span> response.<span style="color: #660066;">Placemark</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> lat <span style="color: #339933;">=</span> place.<span style="color: #660066;">Point</span>.<span style="color: #660066;">coordinates</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> lng <span style="color: #339933;">=</span> place.<span style="color: #660066;">Point</span>.<span style="color: #660066;">coordinates</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Lat:&quot;</span><span style="color: #339933;">+</span>lat<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; - Lng:&quot;</span><span style="color: #339933;">+</span>lng<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here is the HTML that was used to pass the data:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p86code30'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p8630"><td class="code" id="p86code30"><pre class="html" style="font-family:monospace;">Address: &lt;input id=&quot;address&quot; name=&quot;address&quot; type=&quot;text&quot; /&gt;
&nbsp;
City: &lt;input id=&quot;city&quot; name=&quot;city&quot; type=&quot;text&quot; /&gt;
&nbsp;
State: &lt;input id=&quot;state&quot; name=&quot;state&quot; type=&quot;text&quot; /&gt;
&nbsp;
Zip: &lt;input id=&quot;zip&quot; name=&quot;zip&quot; type=&quot;text&quot; /&gt;
&nbsp;
&lt;input onclick=&quot;submitForm();&quot; type=&quot;button&quot; value=&quot;Submit&quot; /&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-javascript-and-google/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latitude and Longitude of a location using PHP and Google</title>
		<link>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google</link>
		<comments>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=40</guid>
		<description><![CDATA[The following PHP code will help you acquire the latitude and longitude of a location (using an address, zip code, or city). Note: Your will be required to have your own domain specific Google API key. View Code PHPif &#40;$_POST&#91;'address'&#93;&#41; &#123; &#160; $key = ' '; //you will need yo use your own domain specific API [...]]]></description>
			<content:encoded><![CDATA[<p>The following PHP code will help you acquire the latitude and longitude of a location (using an address, zip code, or city).</p>
<p>Note: Your will be required to have your own domain specific <a href="http://code.google.com/apis/maps/signup.html" target="_blank">Google API key</a>.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p40code33'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4033"><td class="code" id="p40code33"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//you will need yo use your own domain specific API key</span>
&nbsp;
<span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$addressurl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://maps.google.com/maps/geo?q=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$addressurl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;amp;output=csv&amp;amp;key=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">list</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$stat</span><span style="color: #339933;">,</span><span style="color: #000088;">$acc</span><span style="color: #339933;">,</span><span style="color: #000088;">$lat</span><span style="color: #339933;">,</span><span style="color: #000088;">$lng</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;LAT:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$lat</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - LNG:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$lng</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Below is the HTML code which used a form to submit the address to the above PHP.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p40code34'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4034"><td class="code" id="p40code34"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;;&quot; method=&quot;post&quot;&gt;
&lt;input name=&quot;address&quot; type=&quot;text&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
&lt;/form&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ai for Connect Four &#8211; Half way there</title>
		<link>http://www.digital-epiphany-designs.com/blog/ai-for-connect-four-half-way-there</link>
		<comments>http://www.digital-epiphany-designs.com/blog/ai-for-connect-four-half-way-there#comments</comments>
		<pubDate>Tue, 21 Jul 2009 01:40:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DE Games]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=32</guid>
		<description><![CDATA[Well, first monumental task of world domination is half-way over. I have created my first Ai!! Nothing to be to proud of compared to the masters, but it is getting there. Right now Ai is about in grade 8. About to take the first big step to High School but still loving being a kid. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, first monumental task of world domination is half-way over. I have created my first Ai!!</p>
<p>Nothing to be to proud of compared to the masters, but it is getting there.</p>
<p>Right now Ai is about in grade 8. About to take the first big step to High School but still loving being a kid.</p>
<p>Ai can recognize when he has chips in a row and place them to win. He even knows when he has two in a row and to set up for a third one. Talk about a boy genious right?</p>
<p>I still need to program him to stop the person from winning, but that is comming shortly and should be done within the week.</p>
<p>~dc</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/ai-for-connect-four-half-way-there/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Created Connect Four with XNA game engine</title>
		<link>http://www.digital-epiphany-designs.com/blog/created-connect-four-with-xna-game-engine</link>
		<comments>http://www.digital-epiphany-designs.com/blog/created-connect-four-with-xna-game-engine#comments</comments>
		<pubDate>Fri, 29 May 2009 16:20:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DE Games]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=31</guid>
		<description><![CDATA[I have successfully tought myself C# in conjunction with the XNA game engine! Woot!The first version of the &#8220;Connect Four&#8221; game is out and ready for download. See the game design section of the site for the file.This version only allows 1 vs 1 game play. The options menu does not work as of right [...]]]></description>
			<content:encoded><![CDATA[<p>I have successfully tought myself C# in conjunction with the XNA game engine! Woot!The first version of the &#8220;Connect Four&#8221; game is out and ready for download. See the game design section of the site for the file.This version only allows 1 vs 1 game play. The options menu does not work as of right now. A &#8220;cat&#8217;s game&#8221; is also not recognized.In the future, I will add an AI oppenent that the player will be able to face. Should I have time, I will make the AI vary in difficulty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/created-connect-four-with-xna-game-engine/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

