<?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>MaggsWeb:7 &#187; server</title>
	<atom:link href="http://www.maggsweb.com/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:50:00 +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>Apache server variables</title>
		<link>http://www.maggsweb.com/miscellaneous/apache-server-variables/</link>
		<comments>http://www.maggsweb.com/miscellaneous/apache-server-variables/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 11:32:57 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=642</guid>
		<description><![CDATA[Server Variables are variables set by Apache, and held inside the super global array '$_SERVER'.   They hold very interesting snippits of data available for use, and become very useful when developing PHP projects.]]></description>
			<content:encoded><![CDATA[<h4>Server Variables are variables set by Apache, and held inside the super global array &#8216;$_SERVER&#8217;.   They hold very interesting snippits of data available for use, and become very useful when developing PHP projects.</h4>
<p><span id="more-642"></span></p>
<hr />
<h2>$_SERVER['REQUEST_URI']</h2>
<p>It return the URL in to access the page which is executing the script. If you need to type http://www.example.com/product.php?id=5 to access the page then $_SERVER['REQUEST_URI'] returns “/product.php?id=5.</p>
<h2>$_SERVER['DOCUMENT_ROOT']</h2>
<p>Returns the root directory of the server which is specified in the configuration file of server. This variable usually returns the path like “/usr/yoursite/www” in Linux and “D:/xamps/xampp/htdocs” in windows.</p>
<h2>$_SERVER['HTTP_HOST']</h2>
<p>Returns the host’s name as found in the http header. This variable usually returns the path like “example.com” when the you find “http://example.com” in browser’s address-bar and return “www.example.com” when you see http://www.example.com in the address-bar. This is quite useful when you’ve to preserve session while making online payment using PHP since session stored for “http://example.com” is not same as for the “http://www.example.com”.</p>
<h2>$_SERVER['HTTP_USER_AGENT']</h2>
<p>Returns the user agent’s (browser) detail accessing the web page. We can use strpos($_SERVER["HTTP_USER_AGENT"],”MSIE”) to detect Microsoft Internet explorer or you can use strpos($_SERVER["HTTP_USER_AGENT"],”Firefox”) to detect firefox browser in PHP.</p>
<h2>$_SERVER['PHP_SELF']</h2>
<p>Returns the file-name of the currently executing script. Let’s suppose that you’re accessing the URL http://www.example.com/product.php?id=5 then $_SERVER['PHP_SELF'] returns “/product.php” in your script.</p>
<h2>$_SERVER['QUERY_STRING']</h2>
<p>Returns the query string if query string is used to access the script currently executing. Query strings are those string which is available after “?” sign.if you use $_SERVER['QUERY_STRING'] in the script executing the following URL “http://www.example.com/index.php?id=5&amp;amp;page=product” then it returns “id=5&amp;amp;page=product” in your script.</p>
<h2>$_SERVER['REMOTE_ADDR']</h2>
<p>Returns the IP address of remote machine accessing the current page. But you can’t relie on $_SERVER['REMOTE_ADDR'] to get the real IP address of client’s machine.</p>
<h2>$_SERVER['SCRIPT_FILENAME']</h2>
<p>Returns the absolute path of the file which is currently executing. It returns path like “var/example.com/www/product.php” in Linux and path like “D:/xampp/xampp/htdocs/test/example.php” in windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/miscellaneous/apache-server-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
