Get the name of the current php file

Reply

Join Date: Sep 2004
Posts: 3
Reputation: bratbo is an unknown quantity at this point 
Solved Threads: 0
bratbo bratbo is offline Offline
Newbie Poster

Get the name of the current php file

 
0
  #1
Sep 20th, 2004
I want to make include file with a function, which among other things creates a link to the page itself, with an querystring variable added, how can i get the name of the current php file thus avoiding to have it as a string constant that has to be changed for each different page the include file is included in ?

Regards

Martin Bratbo
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 193
Reputation: YoungCoder is an unknown quantity at this point 
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Re: Get the name of the current php file

 
0
  #2
Sep 21st, 2004
Originally Posted by bratbo
I want to make include file with a function, which among other things creates a link to the page itself, with an querystring variable added, how can i get the name of the current php file thus avoiding to have it as a string constant that has to be changed for each different page the include file is included in ?

Regards

Martin Bratbo
$PHP_SELF :cheesy:
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Get the name of the current php file

 
0
  #3
Sep 24th, 2004
Or, if you (very wisely) do not have auto_globals enabled, then $_SERVER['PHP_SELF'].
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC