<?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>Jess Barnes &#187; PHP</title>
	<atom:link href="http://jessbarnes.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://jessbarnes.com</link>
	<description>Geek / Libertarian / Skeptic / Cook</description>
	<lastBuildDate>Mon, 06 Feb 2012 11:59:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Force SSL by loading the same page via HTTPS</title>
		<link>http://jessbarnes.com/2009/12/force-ssl-by-loading-the-same-page-via-https/</link>
		<comments>http://jessbarnes.com/2009/12/force-ssl-by-loading-the-same-page-via-https/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:46:32 +0000</pubDate>
		<dc:creator>Jess Barnes</dc:creator>
				<category><![CDATA[Code Stuff]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jessbarnes.com/?p=49</guid>
		<description><![CDATA[Just a simple one, I place this in a common file, and then call it at the top of each page that I require to be secured by SSL. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Just a simple one, I place this in a common file, and then call it at the top of each page that I require to be secured by SSL.</p>
<pre class="brush: php; title: ; notranslate">
function force_ssl() {
    if ($_SERVER['HTTPS'] != 'on') {
        header(&quot;Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}&quot;);
        exit();
    }
}
</pre>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://jessbarnes.com/2009/12/force-ssl-by-loading-the-same-page-via-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL string escaping in PHP</title>
		<link>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/</link>
		<comments>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:44:21 +0000</pubDate>
		<dc:creator>Jess Barnes</dc:creator>
				<category><![CDATA[Code Stuff]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jessbarnes.com/?p=47</guid>
		<description><![CDATA[Simple function to prepare user inputted data for inserting into a MySQL database. It simply checks if stripslashes() should be called, and then escapes the string. Basic, but handy. Related posts: PHP function to generate a slug for SEO URLs &#8230; <a href="http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://jessbarnes.com/2010/03/php-function-to-generate-a-slug-for-seo-urls/' rel='bookmark' title='PHP function to generate a slug for SEO URLs'>PHP function to generate a slug for SEO URLs</a></li>
<li><a href='http://jessbarnes.com/2009/12/bash-alias-to-search-file-contents/' rel='bookmark' title='Bash alias to search file contents'>Bash alias to search file contents</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Simple function to prepare user inputted data for inserting into a MySQL database. It simply checks if <code>stripslashes()</code> should be called, and then escapes the string. Basic, but handy.</p>
<pre class="brush: php; title: ; notranslate">
function mysql_escape($string) {
    if (get_magic_quotes_gpc() == 1) {
        $string = stripslashes($string);
    }
    $string = mysql_real_escape_string($string);
    return $string;
}
</pre>
<p>Related posts:<ol>
<li><a href='http://jessbarnes.com/2010/03/php-function-to-generate-a-slug-for-seo-urls/' rel='bookmark' title='PHP function to generate a slug for SEO URLs'>PHP function to generate a slug for SEO URLs</a></li>
<li><a href='http://jessbarnes.com/2009/12/bash-alias-to-search-file-contents/' rel='bookmark' title='Bash alias to search file contents'>Bash alias to search file contents</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The most useful PHP function you&#8217;ll ever use!</title>
		<link>http://jessbarnes.com/2009/12/the-most-useful-php-function-youll-ever-use/</link>
		<comments>http://jessbarnes.com/2009/12/the-most-useful-php-function-youll-ever-use/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:33:55 +0000</pubDate>
		<dc:creator>Jess Barnes</dc:creator>
				<category><![CDATA[Code Stuff]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jessbarnes.com/?p=40</guid>
		<description><![CDATA[This is the first thing I add to any PHP based project and I couldn&#8217;t live without it.. Most people will probably understand and appreciate what this does, but for those that don&#8217;t, it simply displays the contents of an &#8230; <a href="http://jessbarnes.com/2009/12/the-most-useful-php-function-youll-ever-use/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is the first thing I add to any PHP based project and I couldn&#8217;t live without it..</p>
<p>Most people will probably understand and appreciate what this does, but for those that don&#8217;t, it simply displays the contents of an array in a very human readable way by using the <code>&lt;pre&gt;</code> tag to preserve the spacing of the <code>print_r()</code> command.</p>
<pre class="brush: php; title: ; notranslate">
// Debug Array
function da($array) {
    echo &quot;&lt;pre&gt;\n&quot;;
    print_r($array);
    echo &quot;&lt;/pre&gt;\n&quot;;
}
</pre>
<p>Enjoy!</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://jessbarnes.com/2009/12/the-most-useful-php-function-youll-ever-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

