[SOLVED] Another Seemlingly Easy Question-

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
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Another Seemlingly Easy Question-

Post by NewfieBilko »

Hey guys, one more thing for today.

I want to use
($_SERVER

to find the Directory

i use
($_SERVER['PHP_SELF']);

and i get admin/frmAdmin.php

I use basename($_SERVER['PHP_SELF']);
and i get /frmAdmin.php.

How can I just get:

admin


THX
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

try:

Code: Select all

dirname($_SERVER[PHP_SELF]);
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

PS; i scoure php.net right now lookikng for reference to all the $SERVER calls, but cannot find that page... :(
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

ah, dirname, right on, lets see here
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

THX< OP please SOLVED this
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

You know that when you edit or create a reply to your own post you can put SOLVED yourself :)
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

Check
Post Reply