<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" version="2.0">

<channel>
	<title>SL8R.co.uk - Code Zone</title>
	
	<link>http://www.sl8r.co.uk</link>
	<description>Code, Code and Code</description>
	<pubDate>Wed, 23 Jul 2008 15:13:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Sl8r" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">1771605</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>PHP: Select the latest image or file in a folder</title>
		<link>http://www.sl8r.co.uk/2008/07/23/php-select-the-latest-image-or-file-in-a-folder/</link>
		<comments>http://www.sl8r.co.uk/2008/07/23/php-select-the-latest-image-or-file-in-a-folder/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 15:13:34 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[latest]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/?p=47</guid>
		<description><![CDATA[It can be useful to set a placeholder in a web page, such as an image, and for this place holder to be set to be the latest file in a given folder; or to select a random image/file from a given folder and set it as the placeholder. For example in an image of [...]]]></description>
			<content:encoded><![CDATA[<p>It can be useful to set a placeholder in a web page, such as an image, and for this place holder to be set to be the latest file in a given folder; or to select a random image/file from a given folder and set it as the placeholder. For example in an image of the day or daily quote scenario.</p>
<p><code>// set this value to 1 for a random image, or zero for the latest image<br />
$userand = 0;<br />
// folder where the images are located<br />
$dir = "targetfolder";<br />
// filemask to match images<br />
$filemask = "*.{gif}";<br />
// name of the target image<br />
$oldfile = "placeholderfile.gif";<br />
//set a random seed using the system time<br />
mt_srand( (double)microtime()*1000000 );<br />
// change to the given directory<br />
if ( $dir )<br />
{<br />
// change to the given directory<br />
chdir( $dir );<br />
// remove the old latest image - if it exists<br />
if ( file_exists ( $dir . "/" . $oldfile ) ) { unlink( $dir . "/" . $oldfile ); }<br />
// $files = glob( '*.{html,php,php4,txt}', GLOB_BRACE );<br />
$files = glob( $filemask, GLOB_BRACE );<br />
// count the number of files returned<br />
$countfiles = count($files);<br />
// only continue if files are found<br />
if ( $countfiles &gt; 0 )<br />
{<br />
// sort the files into date order<br />
usort( $files, 'compare_filetime' );<br />
// copy the selected file<br />
if ( $userand == 0 )<br />
{<br />
// copy the file<br />
copy ( $dir . "/" . $files[0] , $dir . &#8220;/&#8221; . $oldfile );<br />
}<br />
else<br />
{<br />
// select a random file<br />
$randfile = mt_rand (0, $countfiles-1 );<br />
// copy the random file<br />
copy ( $dir . &#8220;/&#8221; . $files[$randfile] , $dir . &#8220;/&#8221; . $oldfile );<br />
}<br />
}<br />
}<br />
// compare the dates/times of files and return the latest one<br />
function compare_filetime( $file1, $file2 )<br />
{<br />
return filemtime( $file2 ) - filemtime( $file1 );<br />
} </code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F07%2F23%2Fphp-select-the-latest-image-or-file-in-a-folder%2F';
  addthis_title  = 'PHP%3A+Select+the+latest+image+or+file+in+a+folder';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/07/23/php-select-the-latest-image-or-file-in-a-folder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript: CSS rollover List routine</title>
		<link>http://www.sl8r.co.uk/2008/06/18/javascript-css-rollover-list-routine/</link>
		<comments>http://www.sl8r.co.uk/2008/06/18/javascript-css-rollover-list-routine/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 09:56:51 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/06/18/javascript-css-rollover-list-routine/</guid>
		<description><![CDATA[To quickly loop through a list node and set a rollover CSS value, use the following

// Set all LI of a node to rollover CSS
// Use two CSS class, e.g. item and itemover

function updateList(String nodename)
{
    if (document.all&#38;&#38;document.getElementById)
    {
        navRoot = document.getElementById(nodename);
  [...]]]></description>
			<content:encoded><![CDATA[<p>To quickly loop through a list node and set a rollover CSS value, use the following</p>
<div>
<pre class="csharpcode"><span class="rem">// Set all LI of a node to rollover CSS</span>
<span class="rem">// Use two CSS class, e.g. item and itemover</span>

<span class="kwrd">function</span> updateList(String nodename)
{
    <span class="kwrd">if</span> (document.all&amp;&amp;document.getElementById)
    {
        navRoot = document.getElementById(nodename);
        <span class="kwrd">for</span> (i=0; i&lt;navRoot.childNodes.length; i++)
        {
            node = navRoot.childNodes[i];
            <span class="kwrd">if</span> (node.nodeName==<span class="str">&#8220;LI&#8221;</span>)
                {
                    node.onmouseover=<span class="kwrd">function</span>()
                    {
                        <span class="kwrd">this</span>.className+=<span class="str">&#8220;over&#8221;</span>;
                    }
                    node.onmouseout=<span class="kwrd">function</span>()
                    {
                        <span class="kwrd">this</span>.className=<span class="kwrd">this</span>.className.replace(<span class="str">&#8220;over&#8221;</span>, <span class="str">&#8220;&#8221;</span>);
                    }
               }
          }
     }
}

&lt;body&gt;
&lt;script&gt;window.onload=updateList;&lt;/script&gt;
&lt;/body&gt;</pre>
<pre class="csharpcode">
</pre>
</div>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0de6c74f-10f0-4d4a-abfb-30e5077ee94f" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/javascript" rel="tag">javascript</a>,<a href="http://technorati.com/tags/css" rel="tag">css</a>,<a href="http://technorati.com/tags/rollover" rel="tag">rollover</a>,<a href="http://technorati.com/tags/li" rel="tag">li</a></div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F06%2F18%2Fjavascript-css-rollover-list-routine%2F';
  addthis_title  = 'Javascript%3A+CSS+rollover+List+routine';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/06/18/javascript-css-rollover-list-routine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Add Slashes to text</title>
		<link>http://www.sl8r.co.uk/2008/06/03/bits-and-bytes/</link>
		<comments>http://www.sl8r.co.uk/2008/06/03/bits-and-bytes/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 12:00:46 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/06/03/bits-and-bytes/</guid>
		<description><![CDATA[It is sometimes necessary to maintain the special characters in text, such as the apostrophe, speech marks, null character and backslash as these can be mis-interpreted by systems such as SQL if not modified appropriately. The generally accepted method of achieving this is to use the addslashes command which prefixes the special characters with the [...]]]></description>
			<content:encoded><![CDATA[<p>It is sometimes necessary to maintain the special characters in text, such as the apostrophe, speech marks, null character and backslash as these can be mis-interpreted by systems such as SQL if not modified appropriately. The generally accepted method of achieving this is to use the addslashes command which prefixes the special characters with the backslash symbol.</p>
<p>&#160;</p>
<pre class="csharpcode">$inputData = <span class="str">&quot;The is a quote &#8216;&quot;</span>;
$Description = addslashes($inputData);
echo <span class="str">&quot;Revised Text: &quot;</span> . $Description;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>A useful introduction to SEO can be found at:<br />
  <br /><a href="http://www.eggnchips.com/blog/2008/03/31/seo-a-simple-introduction-part-1/">SEO: A simple introduction (part 1)</a>.</p>
<p>This article is bought to you by: <a href="http://www.sl8r.co.uk">SL8R Codezone</a>.</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b81c497b-b4fc-4b23-ad4a-53a221e4b5ac" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/sl8r" rel="tag">sl8r</a>,<a href="http://technorati.com/tags/code%20zone" rel="tag">code zone</a>,<a href="http://technorati.com/tags/code" rel="tag">code</a></div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F06%2F03%2Fbits-and-bytes%2F';
  addthis_title  = 'PHP%3A+Add+Slashes+to+text';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/06/03/bits-and-bytes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript: Set Focus of HTML Textbox</title>
		<link>http://www.sl8r.co.uk/2008/05/23/javascript-set-focus-of-html-textbox/</link>
		<comments>http://www.sl8r.co.uk/2008/05/23/javascript-set-focus-of-html-textbox/#comments</comments>
		<pubDate>Fri, 23 May 2008 16:59:10 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/05/23/javascript-set-focus-of-html-textbox/</guid>
		<description><![CDATA[To set the focus of a HTML text box include this short piece of code in the &#60;head&#62; section
&#60;script&#62;function setfoc() { document.f1.KeyWords.focus(); }
In the example above f1 is the name of the form and KeyWords is the name of the input textbox
In the body section:
&#60;form name="f1" action="youraction" method="POST"&#62;
&#60;input type="text" name="KeyWords" size="40" value="default text"&#62;
&#60;/form&#62;
&#60;script language="JavaScript"&#62;setfoc();&#60;/script&#62;

  [...]]]></description>
			<content:encoded><![CDATA[<p>To set the focus of a HTML text box include this short piece of code in the &lt;head&gt; section</p>
<p><code>&lt;script&gt;function setfoc() { document.f1.KeyWords.focus(); }</code></p>
<p>In the example above f1 is the name of the form and KeyWords is the name of the input textbox</p>
<p>In the body section:</p>
<p><code>&lt;form name="f1" action="youraction" method="POST"&gt;<br />
&lt;input type="text" name="KeyWords" size="40" value="default text"&gt;<br />
&lt;/form&gt;</code></p>
<p><code>&lt;script language="JavaScript"&gt;setfoc();&lt;/script&gt;</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F05%2F23%2Fjavascript-set-focus-of-html-textbox%2F';
  addthis_title  = 'Javascript%3A+Set+Focus+of+HTML+Textbox';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/05/23/javascript-set-focus-of-html-textbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Checking a DNS entry</title>
		<link>http://www.sl8r.co.uk/2008/05/22/php-checking-a-dns-entry/</link>
		<comments>http://www.sl8r.co.uk/2008/05/22/php-checking-a-dns-entry/#comments</comments>
		<pubDate>Thu, 22 May 2008 14:09:04 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/05/22/php-checking-a-dns-entry/</guid>
		<description><![CDATA[It is often useful to check that a given domain name or host is valid, this can be achieved using the checkdnserr() command, as in the following example:
$hostname = "www.domain.com.";
$dnstype = "MX";
$bValid = checkdnserr($hostname,$dnstype);
If using a DNS name then ensure the domain ends with the root domain qualifier (the &#8220;.&#8221;)
If the $dnstype is omitted or [...]]]></description>
			<content:encoded><![CDATA[<p>It is often useful to check that a given domain name or host is valid, this can be achieved using the checkdnserr() command, as in the following example:</p>
<p><code>$hostname = "www.domain.com.";<br />
$dnstype = "MX";<br />
$bValid = checkdnserr($hostname,$dnstype);</code></p>
<p>If using a DNS name then ensure the domain ends with the root domain qualifier (the &#8220;.&#8221;)</p>
<p>If the $dnstype is omitted or left blank the default check will be for an MX (Mail Exchanger) record.</p>
<p><a href="http://uk.php.net/checkdnsrr">http://uk.php.net/checkdnsrr</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F05%2F22%2Fphp-checking-a-dns-entry%2F';
  addthis_title  = 'PHP%3A+Checking+a+DNS+entry';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/05/22/php-checking-a-dns-entry/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Java: Mix up items in array</title>
		<link>http://www.sl8r.co.uk/2008/05/20/java-mix-up-items-in-array/</link>
		<comments>http://www.sl8r.co.uk/2008/05/20/java-mix-up-items-in-array/#comments</comments>
		<pubDate>Tue, 20 May 2008 17:06:26 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[array]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[mix up]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/05/20/java-mix-up-items-in-array/</guid>
		<description><![CDATA[Quick routine to mix up the items in an array
public Object[] MixUpArray(Object inarray[])
{
  // get the size of the array
  int iSize = inarray.length;
  // create an array the same size as the input array
  Object outarray[] = new Object[iSize];
  // Convert the array to a Vector
  Vector&#60;Object&#62; temparray = new Vector&#60;Object&#62;();
  // Copy the [...]]]></description>
			<content:encoded><![CDATA[<p>Quick routine to mix up the items in an array</p>
<p><code>public Object[] MixUpArray(Object inarray[])<br />
{<br />
  // get the size of the array<br />
  int iSize = inarray.length;<br />
  // create an array the same size as the input array<br />
  Object outarray[] = new Object[iSize];<br />
  // Convert the array to a Vector<br />
  Vector&lt;Object&gt; temparray = new Vector&lt;Object&gt;();<br />
  // Copy the array to the Vector<br />
  for ( int i=0; i &lt; iSize; i++ ) temp.add(a[i]);<br />
  // perform the mix up<br />
  for ( int i=0; i &lt; iSize; i++ )<br />
  {<br />
  // Choose a random Vector item<br />
  int iRandom = (int)(Math.random() * iSize);<br />
  // store the chosen vector item in the array<br />
  outarray[i] = temparray.getElementAt(iRandom);<br />
  // remove the item from the vector<br />
  temparray.remove(iRandom);<br />
  }<br />
  // return the new array<br />
  return outarray;<br />
} // method MixUpArray</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F05%2F20%2Fjava-mix-up-items-in-array%2F';
  addthis_title  = 'Java%3A+Mix+up+items+in+array';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/05/20/java-mix-up-items-in-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>J2ME: Bounds checking of a List</title>
		<link>http://www.sl8r.co.uk/2008/05/08/j2me-bounds-checking-of-a-list/</link>
		<comments>http://www.sl8r.co.uk/2008/05/08/j2me-bounds-checking-of-a-list/#comments</comments>
		<pubDate>Thu, 08 May 2008 15:21:52 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[bounds check]]></category>

		<category><![CDATA[j2me]]></category>

		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/05/08/j2me-bounds-checking-of-a-list/</guid>
		<description><![CDATA[This short routine shows how to ensure a selected item in a list is within bounds. If the list is empty the getSelectedIndex will return -1. The index starts at zero whilst size() will start at 1.
// perform bounds checking
int iIndex = myList.getSelectedIndex();
int iCount = myList.size();
// debugging information
System.out.println("Index: " + iIndex + " Size: " [...]]]></description>
			<content:encoded><![CDATA[<p>This short routine shows how to ensure a selected item in a list is within bounds. If the list is empty the getSelectedIndex will return -1. The index starts at zero whilst size() will start at 1.</p>
<p><code>// perform bounds checking<br />
int iIndex = myList.getSelectedIndex();<br />
int iCount = myList.size();<br />
// debugging information<br />
System.out.println("Index: " + iIndex + " Size: " + iCount);<br />
// ensure choice is within bounds<br />
if ( iIndex &lt; 0 || iIndex &gt;= iCount) return;</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F05%2F08%2Fj2me-bounds-checking-of-a-list%2F';
  addthis_title  = 'J2ME%3A+Bounds+checking+of+a+List';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/05/08/j2me-bounds-checking-of-a-list/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Avoiding mySQL Injections</title>
		<link>http://www.sl8r.co.uk/2008/04/30/php-avoiding-mysql-injections/</link>
		<comments>http://www.sl8r.co.uk/2008/04/30/php-avoiding-mysql-injections/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 14:32:36 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[avoid]]></category>

		<category><![CDATA[injection]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/04/30/php-avoiding-mysql-injections/</guid>
		<description><![CDATA[Sample code to avoid SQL injections using mysql_real_escape_string (http://uk.php.net/mysql_real_escape_string) which converts special characters to escape sequences to ensure they are suitable for submission to SQL
$mySQL = "UPDATE address SET postcode='.mysql_real_escape_string($postcode).' WHERE id='.mysql_real_escape_string ($account).'";
$myResult = mysql_query($mySQL);

  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F30%2Fphp-avoiding-mysql-injections%2F';
  addthis_title  = 'PHP%3A+Avoiding+mySQL+Injections';
  addthis_pub    = '';

]]></description>
			<content:encoded><![CDATA[<p>Sample code to avoid SQL injections using mysql_real_escape_string (<a href="http://uk.php.net/mysql_real_escape_string">http://uk.php.net/mysql_real_escape_string</a>) which converts special characters to escape sequences to ensure they are suitable for submission to SQL</p>
<p><code>$mySQL = "UPDATE address SET postcode='.mysql_real_escape_string($postcode).' WHERE id='.mysql_real_escape_string ($account).'";<br />
$myResult = mysql_query($mySQL);</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F30%2Fphp-avoiding-mysql-injections%2F';
  addthis_title  = 'PHP%3A+Avoiding+mySQL+Injections';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/04/30/php-avoiding-mysql-injections/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Require() and Include()</title>
		<link>http://www.sl8r.co.uk/2008/04/23/php-require-and-include/</link>
		<comments>http://www.sl8r.co.uk/2008/04/23/php-require-and-include/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 16:43:20 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Comment]]></category>

		<category><![CDATA[include]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[require]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/04/23/php-require-and-include/</guid>
		<description><![CDATA[Essentially, require() and include() act in much the same way in that they both include the contents of another file - the only difference being that if include() fails then processing will continue (but produce a warning) but if require() fails then processing will stop with a fatal error (as well as produce the warning).

  [...]]]></description>
			<content:encoded><![CDATA[<p>Essentially, require() and include() act in much the same way in that they both include the contents of another file - the only difference being that if include() fails then processing will continue (but produce a warning) but if require() fails then processing will stop with a fatal error (as well as produce the warning).</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F23%2Fphp-require-and-include%2F';
  addthis_title  = 'PHP%3A+Require%28%29+and+Include%28%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/04/23/php-require-and-include/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Defining Constants</title>
		<link>http://www.sl8r.co.uk/2008/04/23/php-defining-constants/</link>
		<comments>http://www.sl8r.co.uk/2008/04/23/php-defining-constants/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 16:36:40 +0000</pubDate>
		<dc:creator>jasonslater</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[constant]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sl8r.co.uk/2008/04/23/php-defining-constants/</guid>
		<description><![CDATA[To define a constant, use the format:
define(constant_name,constant_value,case_insensitive)
e.g.
define(&#8221;MYCONSTANT&#8221;,&#8221;This is the value of the constant&#8221;,false);
print &#8220;Constant is &#8221; . constant(&#8221;MYCONSTANT&#8221;);
?&#62; 

  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F23%2Fphp-defining-constants%2F';
  addthis_title  = 'PHP%3A+Defining+Constants';
  addthis_pub    = '';

]]></description>
			<content:encoded><![CDATA[<p>To define a constant, use the format:</p>
<p><code>define(constant_name,constant_value,case_insensitive)</code></p>
<p>e.g.</p>
<p><code><!--p<-->define(&#8221;MYCONSTANT&#8221;,&#8221;This is the value of the constant&#8221;,false);<br />
print &#8220;Constant is &#8221; . constant(&#8221;MYCONSTANT&#8221;);<br />
?&gt; </code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F23%2Fphp-defining-constants%2F';
  addthis_title  = 'PHP%3A+Defining+Constants';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.sl8r.co.uk/2008/04/23/php-defining-constants/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
