Page 1 of 1

Finding the filename

Posted: Sun Jul 21, 2002 7:48 am
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...

Posted: Sun Jul 21, 2002 9:32 am
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.

Posted: Sun Jul 21, 2002 12:45 pm
by cemlouis
thanx man