<?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>How To PHP - PHP Technology, PHP Tutorial, Database Tutorials, CMS System &#187; AJAX</title>
	<atom:link href="http://www.phpmind.com/blog/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmind.com/blog</link>
	<description>Future of web development</description>
	<lastBuildDate>Tue, 10 Aug 2010 07:19:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>What is ajax synchronous and asynchronous?</title>
		<link>http://www.phpmind.com/blog/2010/07/what-is-ajax-synchronous-and-asynchronous/</link>
		<comments>http://www.phpmind.com/blog/2010/07/what-is-ajax-synchronous-and-asynchronous/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 01:03:34 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=695</guid>
		<description><![CDATA[Synchronous &#8211; Script stops and waits for the server to send back a reply before continuing. There are some situations where Synchronous Ajax is mandatory. In standard Web applications, the interaction between the customer and the server is synchronous. This means that one has to happen after the other. If a customer clicks a link, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Synchronous</strong> &#8211; Script stops and waits for the server to send back a reply before continuing. There are some situations where Synchronous Ajax is mandatory.</p>
<p>In standard Web applications, the interaction between the customer and the server is synchronous. This means that one has to happen after the other. If a customer clicks a link, the request is sent to the server, which then sends the results back.</p>
<p>Because of the danger of a request getting lost and hanging the browser, synchronous javascript isn&#8217;t recommended for anything outside of (onbefore)unload event handlers, but if you need to hear back from the server before you can allow the user to navigate away from the page, synchronous Javascript isn&#8217;t just your best option.</p>
<p><strong>Synchronous AJAX function Example using GET.</strong></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p695code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6953"><td class="code" id="p695code3"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> getFile<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>window<span style="color: #339933;">.</span>XMLHttpRequest<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    AJAX<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    AJAX<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Microsoft.XMLHTTP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>AJAX<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     AJAX<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GET&quot;</span><span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     AJAX<span style="color: #339933;">.</span>send<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">return</span> AJAX<span style="color: #339933;">.</span>responseText<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> fileFromServer <span style="color: #339933;">=</span> getFile<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.phpmind.com/om.txt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Synchronous AJAX function Example using POST.</strong></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p695code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6954"><td class="code" id="p695code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getFile<span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> passData<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>window<span style="color: #339933;">.</span>XMLHttpRequest<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    AJAX<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    AJAX<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Microsoft.XMLHTTP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>AJAX<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    AJAX<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    AJAX<span style="color: #339933;">.</span>setRequestHeader<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    AJAX<span style="color: #339933;">.</span>send<span style="color: #009900;">&#40;</span>passData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> AJAX<span style="color: #339933;">.</span>responseText<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> fileFromServer <span style="color: #339933;">=</span> getFile<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.phpmind.com/data.php'</span><span style="color: #339933;">,</span> sendThisDataAsAPost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Asynchronous</strong> &#8211; Where the script allows the page to continue to be processed and will handle the reply if and when it arrives. If anything goes wrong in the request and/or transfer of the file, your program still has the ability to recognize the problem and recover from it.<br />
Processing asynchronously avoids the delay while the retrieval from the server is taking place because your visitor can continue to interact with the web page and the requested information will be processed with the response updating the page as and when it arrives.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F07%2Fwhat-is-ajax-synchronous-and-asynchronous%2F&amp;linkname=What%20is%20ajax%20synchronous%20and%20asynchronous%3F"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/07/what-is-ajax-synchronous-and-asynchronous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Ajax?</title>
		<link>http://www.phpmind.com/blog/2010/07/what-is-ajax/</link>
		<comments>http://www.phpmind.com/blog/2010/07/what-is-ajax/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 00:59:12 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=693</guid>
		<description><![CDATA[Ajax (sometimes called Asynchronous JavaScript and XML) is a way of programming for the Web that gets rid of the hourglass. Data, content, and design are merged together into a seamless whole. When your customer clicks on something on an Ajax driven application, there is very little lag time. The page simply displays what they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax (sometimes called Asynchronous JavaScript and XML) is a way of programming for the Web that gets rid of the hourglass. Data, content, and design are merged together into a seamless whole. When your customer clicks on something on an Ajax driven application, there is very little lag time. The page simply displays what they&#8217;re asking for.</p>
<p><a href="http://www.phpmind.com/blog/wp-content/uploads/2010/07/XMLHttpRequest-ajax.gif"><img class="size-full wp-image-719 alignnone" title="XMLHttpRequest-ajax" src="http://www.phpmind.com/blog/wp-content/uploads/2010/07/XMLHttpRequest-ajax.gif" alt="" width="503" height="286" /></a></p>
<p style="text-align: center;"><a href="http://www.phpmind.com/blog/wp-content/uploads/2010/07/phpmindAjax.gif"><img class="size-full wp-image-701 aligncenter" title="phpmindAjax" src="http://www.phpmind.com/blog/wp-content/uploads/2010/07/phpmindAjax.gif" alt="" width="376" height="365" /></a></p>
<p>Ajax is a way of developing Web applications that combines:</p>
<ul>
<li>XHTML and CSS standards based presentation</li>
<li>Interaction with the page through the DOM</li>
<li>Data interchange with XML and XSLT</li>
<li>Asynchronous data retrieval with XMLHttpRequest</li>
<li>JavaScript to tie it all together</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F07%2Fwhat-is-ajax%2F&amp;linkname=What%20is%20Ajax%3F"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/07/what-is-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to send bulk email through email software?</title>
		<link>http://www.phpmind.com/blog/2010/02/how-to-send-bulk-email-through-email-software/</link>
		<comments>http://www.phpmind.com/blog/2010/02/how-to-send-bulk-email-through-email-software/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 17:08:12 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=528</guid>
		<description><![CDATA[If you&#8217;re sending an email campaign to thousands or millions of user using some software then you&#8217;re going to need a reliable mail server. Most of the shared servers are not going to allow you send more email. There are a lot of restrictions and host may impose email sending restrictions which makes it impossible [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re sending an email campaign to thousands or millions of user using some software then you&#8217;re going to need a reliable mail server. Most of the shared servers are not going to allow you send more email. There are a lot of restrictions and host may impose email sending restrictions which makes it impossible to send. </p>
<p>There are ways to send –<br />
1. You can send emails out application your web host&#8217;s mail sending engine. This advantage is accomplished if you&#8217;re sending only a few hundred emails per month, about as soon as you go over this, your host will not allow you to send more.  This option is good for sending email using online php tools so many are available please check with google <img src='http://www.phpmind.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
2. You can buy your own committed server from service provider like RackSpace.com or netatlantic.com (we are using this!) and configure it to send emails. We send 60000 emails per month without any issue, they have easy to use web interface. We just create newsletter test and send to our subscribers. It works perfectly.</p>
<p>3. Most effective option is using third party mail server like SMTP.com. Even if you are using shared server you can use there service if you have tones of email to send. Don’t forget to negotiate for discount if you are using there partners software!!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F02%2Fhow-to-send-bulk-email-through-email-software%2F&amp;linkname=How%20to%20send%20bulk%20email%20through%20email%20software%3F"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/02/how-to-send-bulk-email-through-email-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to delete a folder with PHP?</title>
		<link>http://www.phpmind.com/blog/2009/08/how-to-delete-a-folder-with-php/</link>
		<comments>http://www.phpmind.com/blog/2009/08/how-to-delete-a-folder-with-php/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:27:02 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=370</guid>
		<description><![CDATA[To delete a file, or a folder and its contents i have compiled a recursive algorithm. Hope this will be useful for all of you. View Code PHP&#60;?php function rmdirr&#40;$dirname&#41; &#123; &#160; // Sanity check &#160; if &#40;!file_exists&#40;$dirname&#41;&#41; &#123; &#160; return false; &#160; &#125; &#160; &#160; &#160; // Simple delete for a file &#160; if [...]]]></description>
			<content:encoded><![CDATA[<p>To delete a file, or a folder and its contents i have compiled a recursive algorithm.<br />
Hope this will be useful for all of you.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p370code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p3706"><td class="code" id="p370code6"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> rmdirr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Sanity check</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
      <span style="color: #666666; font-style: italic;">// Simple delete for a file</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_file"><span style="color: #990000;">is_file</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <a href="http://www.php.net/is_link"><span style="color: #990000;">is_link</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> <a href="http://www.php.net/unlink"><span style="color: #990000;">unlink</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span>       
&nbsp;
      <span style="color: #666666; font-style: italic;">// Loop through the folder</span>
&nbsp;
      <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$entry</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Skip pointers</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$entry</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$entry</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'..'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Recurse</span>
      rmdirr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$entry</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Clean up</span>
      <span style="color: #000088;">$dir</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> <a href="http://www.php.net/rmdir"><span style="color: #990000;">rmdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2009%2F08%2Fhow-to-delete-a-folder-with-php%2F&amp;linkname=How%20to%20delete%20a%20folder%20with%20PHP%3F"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2009/08/how-to-delete-a-folder-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get the page name of the current URL?</title>
		<link>http://www.phpmind.com/blog/2009/03/how-to-get-the-page-name-of-the-current-url/</link>
		<comments>http://www.phpmind.com/blog/2009/03/how-to-get-the-page-name-of-the-current-url/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 07:29:05 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=261</guid>
		<description><![CDATA[Using this script you can get PHP current page from a url. function CPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } echo "The current page name is ".CPageName();]]></description>
			<content:encoded><![CDATA[<p>Using this script you can get PHP current page from a url.</p>
<pre name="code" class="php">
function CPageName() {
 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}

echo "The current page name is ".CPageName();
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2009%2F03%2Fhow-to-get-the-page-name-of-the-current-url%2F&amp;linkname=How%20to%20get%20the%20page%20name%20of%20the%20current%20URL%3F"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2009/03/how-to-get-the-page-name-of-the-current-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
