Re: How to Get URL?

From: Date: Mon, 14 Mar 2005 01:53:43 +0000
Subject: Re: How to Get URL?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-210639@lists.php.net to get a copy of this message
Labunski wrote:
How to get url of the page the php script is on? In other words, I want to know whether I'm in page "news.php" or in "posts.php", or in some other page. Is there any simple way to get tis info? Thanks, Lab. if (basename($_SERVER['PHP_SELF']) == 'news.php')
{ // do whatever you want }

« previous php.general (#210639) next »