How may I retrieve the filename of itself dynamically???

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
creata
Forum Newbie
Posts: 4
Joined: Fri Sep 06, 2002 10:07 am

How may I retrieve the filename of itself dynamically???

Post by creata »

8O How may I retrive the file attributes of itself dynamically by PHP. I can't find this kind of information from my books. Please help.

Besides, if anyone know which book on this topic, please let me have the details. Thanks.

:D
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Try looking through the PHP manual. http://www.php.net/manual
creata
Forum Newbie
Posts: 4
Joined: Fri Sep 06, 2002 10:07 am

thanks... can you give me a search term???

Post by creata »

as captioned.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

As a brief aside - putting your message in the message body instead of in the subject makes it less confusing to try and work out what the question/answer/anything is?

What filename are you looking for specifically? The scripts name:

Code: Select all

$_SERVERї'PHP_SELF']
Mac
creata
Forum Newbie
Posts: 4
Joined: Fri Sep 06, 2002 10:07 am

thank you

Post by creata »

WOW!!! It's worked.

Indeed, I have a PHP script + mySQL on an online photo gallery where I set each photo's filename as variable. Now, I needed to hard-coded each photo's filename so that it will do all the things following automatically.

Now I can using the thing you teached me + some string manipulation (to get rig of the "/") to complete my job.

Thanks very much!!!
Post Reply