User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,849 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,793 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 30605 | Replies: 2
Reply
Join Date: Sep 2004
Posts: 3
Reputation: bratbo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bratbo bratbo is offline Offline
Newbie Poster

Get the name of the current php file

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Posts: 177
Reputation: YoungCoder is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Re: Get the name of the current php file

  #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  
Join Date: Feb 2003
Location: London, England
Posts: 281
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Rep Power: 7
Solved Threads: 6
Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Get the name of the current php file

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

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:18 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC