<?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"
	>

<channel>
	<title>Developing PHP</title>
	<atom:link href="http://www.developing-php.com/articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.developing-php.com/articles</link>
	<description>Articles and Example Code in PHP/MySQL/Javascript</description>
	<pubDate>Tue, 22 Jul 2008 01:41:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Stop bots from submitting contact forms</title>
		<link>http://www.developing-php.com/articles/2008/07/21/stop-bots-from-submitting-contact-forms/</link>
		<comments>http://www.developing-php.com/articles/2008/07/21/stop-bots-from-submitting-contact-forms/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 01:41:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php general]]></category>

		<category><![CDATA[forms]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=23</guid>
		<description><![CDATA[I have been using this code for a while and it seems to work but i don&#8217;t think it is 100% infallible. It is used to stop robots from submitting your contact forms, or any kind of forms really. The code can be found at
:-
http://www.phpclasses.org/browse/package/3817.html
]]></description>
			<content:encoded><![CDATA[<p>I have been using this code for a while and it seems to work but i don&#8217;t think it is 100% infallible. It is used to stop robots from submitting your contact forms, or any kind of forms really. The code can be found at<br />
:-</p>
<p><a href="http://www.phpclasses.org/browse/package/3817.html">http://www.phpclasses.org/browse/package/3817.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/21/stop-bots-from-submitting-contact-forms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript version of php in_array</title>
		<link>http://www.developing-php.com/articles/2008/07/20/javascript-version-of-php-in_array/</link>
		<comments>http://www.developing-php.com/articles/2008/07/20/javascript-version-of-php-in_array/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:59:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General Javascript]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=21</guid>
		<description><![CDATA[I was working with javascript arrays and needed to find a needle in a haystack or a value in an array. I came across this function:-

function js_in_array&#40;the_needle, the_haystack&#41;&#123;
   var the_hay = the_haystack.toString&#40;&#41;;
   if&#40;the_hay == ''&#41;&#123;
      return false;
   &#125;
   var the_pattern = new [...]]]></description>
			<content:encoded><![CDATA[<p>I was working with javascript arrays and needed to find a needle in a haystack or a value in an array. I came across this function:-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> js_in_array<span style="color: #009900;">&#40;</span>the_needle<span style="color: #339933;">,</span> the_haystack<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> the_hay <span style="color: #339933;">=</span> the_haystack.<span style="color: #006600;">toString</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;">if</span><span style="color: #009900;">&#40;</span>the_hay <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: #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: #003366; font-weight: bold;">var</span> the_pattern <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span>the_needle<span style="color: #339933;">,</span> <span style="color: #3366CC;">'g'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> matched <span style="color: #339933;">=</span> the_pattern.<span style="color: #006600;">test</span><span style="color: #009900;">&#40;</span>the_haystack<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">return</span> matched<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/20/javascript-version-of-php-in_array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Change the visibility of a html element</title>
		<link>http://www.developing-php.com/articles/2008/07/20/change-the-visibility-of-a-html-element/</link>
		<comments>http://www.developing-php.com/articles/2008/07/20/change-the-visibility-of-a-html-element/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:57:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General Javascript]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=19</guid>
		<description><![CDATA[I often use this code to toggle the visibility of a HTML element on the page. It is especially useful with forms and showing different option depending on what the user selects. Here is the code:-

function ToggleVis&#40;element&#41;&#123;
   var Target=document.getElementById&#40;element&#41;;
   if&#40;Target.style.display==&#34;&#34;&#41;&#123;
      Target.style.display=&#34;none&#34;;
   &#125;else&#123;
   [...]]]></description>
			<content:encoded><![CDATA[<p>I often use this code to toggle the visibility of a HTML element on the page. It is especially useful with forms and showing different option depending on what the user selects. Here is the code:-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> ToggleVis<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> Target<span style="color: #339933;">=</span>document.<span style="color: #006600;">getElementById</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>Target.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      Target.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;none&quot;</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>
      Target.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/20/change-the-visibility-of-a-html-element/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dynamically load javascript code in page</title>
		<link>http://www.developing-php.com/articles/2008/07/20/dynamically-load-javascript-code-in-page/</link>
		<comments>http://www.developing-php.com/articles/2008/07/20/dynamically-load-javascript-code-in-page/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:56:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General Javascript]]></category>

		<category><![CDATA[dhtml]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=17</guid>
		<description><![CDATA[In the IWebBiz CMS individual content objects may need their own javascript code to process them. So I load each individual javascript file as needed. The code to do this is:-

function dhtmlLoadScript&#40;url&#41;
&#123;
   var e = document.createElement&#40;&#34;script&#34;&#41;;
   e.src = url;
   e.type=&#34;text/javascript&#34;;
   document.getElementsByTagName&#40;&#34;head&#34;&#41;&#91;0&#93;.appendChild&#40;e&#41;;
&#125;

]]></description>
			<content:encoded><![CDATA[<p>In the IWebBiz CMS individual content objects may need their own javascript code to process them. So I load each individual javascript file as needed. The code to do this is:-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> dhtmlLoadScript<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> document.<span style="color: #006600;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   e.<span style="color: #006600;">src</span> <span style="color: #339933;">=</span> url<span style="color: #339933;">;</span>
   e.<span style="color: #006600;">type</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006600;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006600;">appendChild</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/20/dynamically-load-javascript-code-in-page/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is a variable a number</title>
		<link>http://www.developing-php.com/articles/2008/07/20/is-a-variable-a-number/</link>
		<comments>http://www.developing-php.com/articles/2008/07/20/is-a-variable-a-number/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:54:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General Javascript]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=15</guid>
		<description><![CDATA[Often we need to see whether a variable is a number. Here is the code:-

function IsNumeric&#40;sText&#41;
&#160;
&#123;
   var ValidChars = &#34;0123456789.&#34;;
   var IsNumber=true;
   var Char;
&#160;
&#160;
   for &#40;i = 0; i &#60; sText.length &#38;&#38; IsNumber == true; i++&#41;
      &#123;
      [...]]]></description>
			<content:encoded><![CDATA[<p>Often we need to see whether a variable is a number. Here is the code:-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> IsNumeric<span style="color: #009900;">&#40;</span>sText<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> ValidChars <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;0123456789.&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> IsNumber<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> Char<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
   <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</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> sText.<span style="color: #006600;">length</span> <span style="color: #339933;">&amp;&amp;</span> IsNumber <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      Char <span style="color: #339933;">=</span> sText.<span style="color: #006600;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ValidChars.<span style="color: #006600;">indexOf</span><span style="color: #009900;">&#40;</span>Char<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">-1</span><span style="color: #009900;">&#41;</span>
         <span style="color: #009900;">&#123;</span>
         IsNumber <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #000066; font-weight: bold;">return</span> IsNumber<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/20/is-a-variable-a-number/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scrolling Marquee Text</title>
		<link>http://www.developing-php.com/articles/2008/07/20/scrolling-marquee-text/</link>
		<comments>http://www.developing-php.com/articles/2008/07/20/scrolling-marquee-text/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:30:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General Javascript]]></category>

		<category><![CDATA[dhtml]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=10</guid>
		<description><![CDATA[I recently had a website that needed scrolling pictures from the right to the left. It was a photo album and it achieved this with a marquee tag. I also wanted to increase the speed of the scrolling via javascript so if the users went back to the page it would be simple to scroll [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a website that needed scrolling pictures from the right to the left. It was a photo album and it achieved this with a marquee tag. I also wanted to increase the speed of the scrolling via javascript so if the users went back to the page it would be simple to scroll back to the point they left at. Here is the code:-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #339933;">&lt;</span>div align<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;left&quot;</span><span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>button  <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;FormButtons&quot;</span> onmouseover<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scroll(50)&quot;</span>
onmouseout<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scroll(10)&quot;</span>
<span style="color: #339933;">&gt;&lt;&lt;</span> <span style="color: #000066;">Scroll</span> Faster<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span>speed<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document.<span style="color: #006600;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;scroller&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">scrollAmount</span> <span style="color: #339933;">=</span> speed<span style="color: #339933;">;</span>
scroller.<span style="color: #006600;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
              <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
              <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
              <span style="color: #339933;">&lt;</span>marquee <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scroller&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scroller&quot;</span>  behavior<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;slide&quot;</span> direction<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;left&quot;</span> loop<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;9999999999&quot;</span><span style="color: #339933;">&gt;</span>
something to <span style="color: #000066;">scroll</span>
          <span style="color: #339933;">&lt;/</span>marquee<span style="color: #339933;">&gt;</span></pre></div></div>

<p>An example of the code can be seen at http://www.sirensmodels.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/20/scrolling-marquee-text/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Welcome To Developing PHP Articles</title>
		<link>http://www.developing-php.com/articles/2008/07/19/hello-world/</link>
		<comments>http://www.developing-php.com/articles/2008/07/19/hello-world/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 06:04:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.developing-php.com/articles/?p=1</guid>
		<description><![CDATA[Hello there, we have had a PHPBB website for over a year now but it has been plagued with spammers and hackers so i have decided to start anew with a blog. Wordpress seemed the logical system to use as i have had some experience with it so here we are. I will be transferring [...]]]></description>
			<content:encoded><![CDATA[<p>Hello there, we have had a PHPBB website for over a year now but it has been plagued with spammers and hackers so i have decided to start anew with a blog. Wordpress seemed the logical system to use as i have had some experience with it so here we are. I will be transferring the posts from the old site into this new one and writing new articles in here and not in the old site. Commenting will have members strictly verified as the old site i was spending more time deleting links to nude jennifer anderston than writing about programming.</p>
<p>Hope you enjoy the new format,</p>
<p>Daniel Ruul.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developing-php.com/articles/2008/07/19/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
