<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Use PHP to get the current page/file name</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/</link>
	<description></description>
	<pubDate>Mon, 21 Jul 2008 01:28:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: aequalsb</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532918</link>
		<dc:creator>aequalsb</dc:creator>
		<pubDate>Tue, 16 Oct 2007 14:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532918</guid>
		<description>oops... in the post above, the PHP code wasn't translated automatically into HTML entities and looks like it may have been removed...

maybe scriptygoddess can check the post and fix it.  otherwise, i no longer have the time to resubmit my post...</description>
		<content:encoded><![CDATA[<p>oops&#8230; in the post above, the PHP code wasn&#8217;t translated automatically into HTML entities and looks like it may have been removed&#8230;</p>
<p>maybe scriptygoddess can check the post and fix it.  otherwise, i no longer have the time to resubmit my post&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aequalsb</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532917</link>
		<dc:creator>aequalsb</dc:creator>
		<pubDate>Tue, 16 Oct 2007 14:34:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532917</guid>
		<description>@Brad

if i'm understanding you correctly, you will have to track this yourself through some scripting method.

example:
========================








========================

unfortunately, there is no built-in function to automatically track a set of files that were included -- that i know of...</description>
		<content:encoded><![CDATA[<p>@Brad</p>
<p>if i&#8217;m understanding you correctly, you will have to track this yourself through some scripting method.</p>
<p>example:<br />
========================</p>
<p>========================</p>
<p>unfortunately, there is no built-in function to automatically track a set of files that were included &#8212; that i know of&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532903</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Tue, 16 Oct 2007 09:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-532903</guid>
		<description>How would you go about tweaking this to make it show "included" php flie names?</description>
		<content:encoded><![CDATA[<p>How would you go about tweaking this to make it show &#8220;included&#8221; php flie names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aequalsb</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-530027</link>
		<dc:creator>aequalsb</dc:creator>
		<pubDate>Thu, 20 Sep 2007 17:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-530027</guid>
		<description>my god...

just use --&#62;
basename( $_SERVER[â€SCRIPT_NAMEâ€] )</description>
		<content:encoded><![CDATA[<p>my god&#8230;</p>
<p>just use &#8211;&gt;<br />
basename( $_SERVER[â€SCRIPT_NAMEâ€] )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bahodir</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-529950</link>
		<dc:creator>bahodir</dc:creator>
		<pubDate>Wed, 19 Sep 2007 07:42:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-529950</guid>
		<description>filename without path can be found by this way:

substr($_SERVER["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"],"/") + 1)</description>
		<content:encoded><![CDATA[<p>filename without path can be found by this way:</p>
<p>substr($_SERVER["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"],&#8221;/&#8221;) + 1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: _ck_</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525928</link>
		<dc:creator>_ck_</dc:creator>
		<pubDate>Sun, 19 Aug 2007 14:06:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525928</guid>
		<description>If you dig around the wordpress/bbpress code you'll see that PHP_SELF doesn't always work as wanted on Windows servers with PHP, etc. They have a function that tries it three different ways!</description>
		<content:encoded><![CDATA[<p>If you dig around the wordpress/bbpress code you&#8217;ll see that PHP_SELF doesn&#8217;t always work as wanted on Windows servers with PHP, etc. They have a function that tries it three different ways!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aequalsb</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525641</link>
		<dc:creator>aequalsb</dc:creator>
		<pubDate>Thu, 16 Aug 2007 18:02:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525641</guid>
		<description>@Farhan

that's why you use the basename function (as clearly inidcated in the example)
  basename( $_SERVER['PHP_SELF'] )

so "echo $_SERVER['PHP_SELF'] will output something like
   /www/htdocs/index.php
whereas "echo basename ( $_SERVER['PHP_SELF'] ) will output
   index.php

basename() is a built-in PHP function...</description>
		<content:encoded><![CDATA[<p>@Farhan</p>
<p>that&#8217;s why you use the basename function (as clearly inidcated in the example)<br />
  basename( $_SERVER['PHP_SELF'] )</p>
<p>so &#8220;echo $_SERVER['PHP_SELF'] will output something like<br />
   /www/htdocs/index.php<br />
whereas &#8220;echo basename ( $_SERVER['PHP_SELF'] ) will output<br />
   index.php</p>
<p>basename() is a built-in PHP function&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: meowminx</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525633</link>
		<dc:creator>meowminx</dc:creator>
		<pubDate>Thu, 16 Aug 2007 16:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525633</guid>
		<description>Hi! I wanted to leave this comment in the htaccess bit, but I couldn't find the comment form. I just want to thank you for the piece of code in the htaccess you have! I finally got it working without throwing a 500 internal server error! My friend has been puzzled as to why the code she gave me kept doing that! Thank you so much!</description>
		<content:encoded><![CDATA[<p>Hi! I wanted to leave this comment in the htaccess bit, but I couldn&#8217;t find the comment form. I just want to thank you for the piece of code in the htaccess you have! I finally got it working without throwing a 500 internal server error! My friend has been puzzled as to why the code she gave me kept doing that! Thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farhan Razzak</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525593</link>
		<dc:creator>Farhan Razzak</dc:creator>
		<pubDate>Thu, 16 Aug 2007 07:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-525593</guid>
		<description>Good example  Mr.aequalsb 
u have clearly explain both things ,
but $_SERVER["PHP-SELF"] gives the absolute path not the exact file name.</description>
		<content:encoded><![CDATA[<p>Good example  Mr.aequalsb<br />
u have clearly explain both things ,<br />
but $_SERVER["PHP-SELF"] gives the absolute path not the exact file name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aequalsb</title>
		<link>http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-524068</link>
		<dc:creator>aequalsb</dc:creator>
		<pubDate>Wed, 01 Aug 2007 20:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/#comment-524068</guid>
		<description>actually...

"echo basename( $_SERVER['PHP_SELF'] )" and "echo basename( __FILE__ )" can return the same results or entirely different results.

why? __FILE__ always refers to the file ITSELF -- whether it is included or not whereas PHP_SELF always refers to the "parent" file (the one doing the including).

you can memorize it like this --&#62; (P)HP_SELF = (P)arent and __FILE__ = __child

for more details, check this URL where i've set up an example:
http://abdstudios.net/examples/dirname-basename/

i hope my studies to understand this can help everyone else :)</description>
		<content:encoded><![CDATA[<p>actually&#8230;</p>
<p>&#8220;echo basename( $_SERVER['PHP_SELF'] )&#8221; and &#8220;echo basename( __FILE__ )&#8221; can return the same results or entirely different results.</p>
<p>why? __FILE__ always refers to the file ITSELF &#8212; whether it is included or not whereas PHP_SELF always refers to the &#8220;parent&#8221; file (the one doing the including).</p>
<p>you can memorize it like this &#8211;&gt; (P)HP_SELF = (P)arent and __FILE__ = __child</p>
<p>for more details, check this URL where i&#8217;ve set up an example:<br />
<a href="http://abdstudios.net/examples/dirname-basename/" rel="nofollow">http://abdstudios.net/examples/dirname-basename/</a></p>
<p>i hope my studies to understand this can help everyone else <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.291 seconds -->
