<?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>Sid Roberts &#187; PHP</title>
	<atom:link href="http://www.sidroberts.co.uk/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sidroberts.co.uk</link>
	<description>Well, hello there! This is the site of Sid Roberts - a web developer in Leeds, England. I'm a 16-year old high school student studying Computing, Mathematics (Mechanics), Further Maths and Economics.</description>
	<lastBuildDate>Sat, 30 Jan 2010 15:49:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Define Or Die</title>
		<link>http://www.sidroberts.co.uk/2008/03/08/define-or-die/</link>
		<comments>http://www.sidroberts.co.uk/2008/03/08/define-or-die/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 18:35:46 +0000</pubDate>
		<dc:creator>Sid Roberts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[define]]></category>
		<category><![CDATA[defined]]></category>
		<category><![CDATA[die]]></category>

		<guid isPermaLink="false">http://www.sidroberts.co.uk/2008/03/08/define-or-die/</guid>
		<description><![CDATA[Want to stop a PHP file from being opened directly instead of through another? This can be particularly useful for PHP files that depend on another or just to keep security tight. So how do this work? PHP allows you to define something and you can then check to see if it is defined somewhere [...]]]></description>
			<content:encoded><![CDATA[<p>Want to stop a <acronym title="PHP: Hypertext Processor">PHP</acronym> file from being opened directly instead of through another? This can be particularly useful for <acronym title="PHP: Hypertext Processor">PHP</acronym> files that depend on another or just to keep security tight.</p>
<p>So how do this work? <acronym title="PHP: Hypertext Processor">PHP</acronym> allows you to <code><a href="http://php.net/define">define</a></code> something and you can then check to see if it is <code><a href="http://php.net/defined">defined</a></code> somewhere else in the code.</p>
<p>Should be one of the very first, if not the first, lines in your main file.</p>
<pre><code>// Let's define it!
define('ABC');</code></pre>
<p>Place this at the top of every other page that you want to be forced through the main one.</p>
<pre><code>if(!defined('ABC'))
	die();</code></pre>
<p>Although it seems so simple, you’d be surprised at how many scripts aren’t protected. <a href="http://www.wordpress.org/">WordPress</a>, for instance, doesn’t which allows you to look at theme files amongst other things.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sidroberts.co.uk/2008/03/08/define-or-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
