Finding the filename

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
cemlouis
Forum Newbie
Posts: 4
Joined: Sun Jul 21, 2002 7:48 am

Finding the filename

Post by cemlouis »

For example i have a a.php and i have included a b.php in this a.php . I want this script (in b.php) shows the filename of a.php. I am doing this omitting after the $PHP_SELF 's last slash(/) Then script finds the filename as a.php . Now the question: lets we entered in the url like http://www.mysite.com/a then it finds the .php part but not written in the url. I mean does $PHP_SELF shows a.php or a in all server types? Another question there is a frame on the page and the url seen like http://www.mysite.com but the calling script in the frame is http://www.mysite.com/a.php in this situation what the $PHP_SELF gives?

I think everything is clear, Sorry about my language because i am not an english spoken man. Thanx for reading...
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post by fatalcure »

well no, i dont think a file named just "a" will be parsed by PHP, b/c php is looking for the .php extension, then it runs it through the parser.

If you want to parse the filename just "a" through php, you have to upload a .htaccess file to ur server and it in type:

<Files a>
ForceType application/x-httpd-php
</Files>

now, just a file name "a" will be parsed w/ php.

As for the frame situation, it'll still echo the script name, doesn't matter if it's in a frame or not.
cemlouis
Forum Newbie
Posts: 4
Joined: Sun Jul 21, 2002 7:48 am

Post by cemlouis »

thanx man
Post Reply