Forum Moderators: coopster

Message Too Old, No Replies

Getting info on the php file

Can I get the name of the file while processing in it?

         

Captaffy

8:49 pm on Jun 20, 2003 (gmt 0)

10+ Year Member



In order to save myself from hard coding page names within numerous files, I would prefer it if the php file could get its own file name so that it could then put it in a link like <a href="$file_name?id=0">.

I could do this in ASP, and want to know if and how it can be accomplished in PHP.

dingman

9:27 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you want $_SERVER["SCRIPT_NAME"], but you might also look at:

$_SERVER["PHP_SELF"]
$_SERVER["PATH_TRANSLATED"]
$_SERVER["SCRIPT_FILENAME"]

Captaffy

11:14 pm on Jun 20, 2003 (gmt 0)

10+ Year Member



Thanks, that will help me out a lot.