global variables..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IAD
Forum Commoner
Posts: 42
Joined: Wed Dec 28, 2005 12:36 pm
Location: Israel, Soon Canada :)

global variables..

Post by IAD »

Hey,

i wanted to know if there's a way to get only the page's name without the folder name [index.php] and not [forum/index.php]..

Thanks, Tal.
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post by mickd »

this function might do you well. basename
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
The current scriptname is found in this global variable:

Code: Select all

$_SERVER["SCRIPT_NAME"]
djot
-
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

fyi it never hurts to have a look in

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
to give you an idea of what's needed
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
@jcart

or use phpinfo()

? || :)


djot
-
Post Reply