<?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>Kurinchi Blogger Scribbles ... &#187; register globals</title>
	<atom:link href="http://kurinchilamp.kurinchilion.com/tag/register-globals/feed" rel="self" type="application/rss+xml" />
	<link>http://kurinchilamp.kurinchilion.com</link>
	<description>On Open Source Technologies</description>
	<lastBuildDate>Mon, 02 Jan 2012 06:14:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to turn off register_globals via php.ini?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html#comments</comments>
		<pubDate>Thu, 16 Jul 2009 13:54:06 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP security]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[register globals]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=503</guid>
		<description><![CDATA[It is always secured to turn OFF register_globals in PHP applications. Earlier, we have seen how to turn OFF register_globals setting via .htaccess file and in this blog we will use php.ini instead. Using a text editor create a file called php.ini. This will be our first step. Next, we need to add the following [...]]]></description>
			<content:encoded><![CDATA[<p>It is always secured to turn OFF register_globals in PHP applications. Earlier, we have seen how to turn OFF register_globals setting via .htaccess file and in this blog we will use php.ini instead.</p>
<p>Using a text editor create a file called php.ini. This will be our first step.</p>
<p>Next, we need to add the following line of code in php.ini<br />
<strong>register_globals = off</strong></p>
<p>Upload php.ini file to the root folder where your application resides.</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Register Globals and Security Vulnerability</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/05/register-globals-and-security-vulnerability.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/05/register-globals-and-security-vulnerability.html#comments</comments>
		<pubDate>Thu, 21 May 2009 00:55:07 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[global variables]]></category>
		<category><![CDATA[regis]]></category>
		<category><![CDATA[register globals]]></category>
		<category><![CDATA[register_globals]]></category>
		<category><![CDATA[security vulnerability]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=341</guid>
		<description><![CDATA[Register Globals directive is turned OFF from PHP version 4.2. PHP Global Variables Environment variables, GET, POST, Server, Cookie variables are knows as Global Variables. When register_globals directive is turned ON (like what most ISP&#8217;s did), you can access/set the global variables like $username, $password instead of $_POST["username"], $_POST["password"]. To turn OFF register global variables, [...]]]></description>
			<content:encoded><![CDATA[<p><em>Register Globals directive is turned OFF from PHP version 4.2.</em></p>
<p><strong>PHP Global Variables</strong><br />
Environment variables, GET, POST, Server, Cookie variables are knows as Global Variables.</p>
<p>When register_globals directive is turned ON (like what most ISP&#8217;s did), you can access/set the global variables like $username, $password instead of $_POST["username"], $_POST["password"].<br />
<span id="more-341"></span><br />
To turn OFF register global variables, you can add a setting to <strong>.htaccess </strong>like &#8230;<br />
<strong>php_flag register_globals off</strong></p>
<p><strong>What is the harm when register_globals is turned ON?</strong></p>
<p>Take the below code for example.</p>
<p><strong>Program: displayuser.php</strong></p>
<pre class="brush: php">
<?php
if($isValidUser){
   // List confidential data
}else{
   // Display error message
}
?>
</pre>
<p>If register_global is turned ON, you can display the confidential data from the above program by accessing <strong>http://www.yoursite.com/displayuser.php?isValidUser=1</strong></p>
<p>So is the case with the other global variables. This is because in PHP we needn&#8217;t have to initialize variables in our program before its access.</p>
<p><strong>How to find if register_globals is turned ON/OFF?</strong></p>
<p><em>Two easy methods &#8230;</em></p>
<p>i) from phpinfo() function which will display a whole load of data on your environment</p>
<pre class="brush: php">
<?php
phpinfo();
?>
</pre>
<p>ii) by declaring a having a form data or session data declared in one page and trying to set the variable ON/OFF in the second page via querystring</p>
<p><strong>REMEMBER</strong>: From PHP 6 register global directive will be REMOVED. So do not depend on it in your programs.</p>
<p><strong>Two things to remember for beginners!</strong><br />
i) initialize variables<br />
ii) validate EVERY user input</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/05/register-globals-and-security-vulnerability.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

