<?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>Mukesh Chapagain&#039;s Blog &#187; server</title>
	<atom:link href="http://blog.chapagain.com.np/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chapagain.com.np</link>
	<description>PHP Magento jQuery SQL Wordpress Joomla Programming &#38; Tutorial</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>How to get working site path and directory name in php?</title>
		<link>http://blog.chapagain.com.np/how-to-get-working-site-path-and-directory-name-in-php/</link>
		<comments>http://blog.chapagain.com.np/how-to-get-working-site-path-and-directory-name-in-php/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 13:29:23 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=118</guid>
		<description><![CDATA[Let the page path be: http://localhost/test/admin/index.php Get the server name/site name of your website: echo $_SERVER['SERVER_NAME']; or, echo $_SERVER['HTTP_HOST']; This will print: localhost Get the path of the page you are working on: echo $_SERVER['PHP_SELF']; This will print: /test/admin/index.php Get only the directory name of the page you are working on, i.e. if you don&#8217;t [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/php-how-to-get-main-or-base-url/' rel='bookmark' title='Permanent Link: PHP: How to get Main or Base URL?'>PHP: How to get Main or Base URL?</a></li>
<li><a href='http://blog.chapagain.com.np/website-statistic-user-information-in-php/' rel='bookmark' title='Permanent Link: Website statistic (User Information) in PHP'>Website statistic (User Information) in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/fun-with-strings-in-php-part-1/' rel='bookmark' title='Permanent Link: Fun with strings in PHP (Part 1)'>Fun with strings in PHP (Part 1)</a></li>
<li><a href='http://blog.chapagain.com.np/session-handling-in-php/' rel='bookmark' title='Permanent Link: Session Handling in PHP'>Session Handling in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-simplexml/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with SimpleXML'>PHP : Read Write Xml with SimpleXML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Let the page path be: http://localhost/test/admin/index.php</p>
<p>Get the server name/site name of your website:</p>
<p><strong>echo $_SERVER['SERVER_NAME'];</strong></p>
<p><span id="more-118"></span></p>
<p>or,</p>
<p><strong>echo $_SERVER['HTTP_HOST'];</strong></p>
<p>This will print: localhost</p>
<p>Get the path of the page you are working on:</p>
<p><strong>echo $_SERVER['PHP_SELF'];</strong></p>
<p>This will print: /test/admin/index.php</p>
<p>Get only the directory name of the page you are working on, i.e. if you don&#8217;t want the file name to be displayed:</p>
<p><strong>echo dirname($_SERVER['PHP_SELF']);</strong></p>
<p>This will print: /test/admin</p>
<p>If you want to omit the &#8216;admin&#8217; directory as well then you can use dirname() function two times:</p>
<p><strong>echo dirname(dirname($_SERVER['PHP_SELF']));</strong></p>
<p>This will print: /test</p>
<p>Finally:</p>
<p><strong>echo &#8220;http://&#8221;.dirname($_SERVER['SERVER_NAME'].&#8221;".$_SERVER['PHP_SELF']);</strong></p>
<p>This will print: http://localhost/test/admin</p>
<p>Enjoy PHPing :)</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=118&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/php-how-to-get-main-or-base-url/' rel='bookmark' title='Permanent Link: PHP: How to get Main or Base URL?'>PHP: How to get Main or Base URL?</a></li>
<li><a href='http://blog.chapagain.com.np/website-statistic-user-information-in-php/' rel='bookmark' title='Permanent Link: Website statistic (User Information) in PHP'>Website statistic (User Information) in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/fun-with-strings-in-php-part-1/' rel='bookmark' title='Permanent Link: Fun with strings in PHP (Part 1)'>Fun with strings in PHP (Part 1)</a></li>
<li><a href='http://blog.chapagain.com.np/session-handling-in-php/' rel='bookmark' title='Permanent Link: Session Handling in PHP'>Session Handling in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-simplexml/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with SimpleXML'>PHP : Read Write Xml with SimpleXML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/how-to-get-working-site-path-and-directory-name-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
