473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get .PHP Filename?

I've been looking thru my PHP functions and can't find what I need -
is there a function that will tell me what .php file is currently
executing?

Thanks...

Jul 16 '05 #1
4 23972
Ralph Freshour <ra***@primemail.com> wrote in
news:21********************************@4ax.com:
I've been looking thru my PHP functions and can't find what I need -
is there a function that will tell me what .php file is currently
executing?

$_GET['SCRIPT_NAME'] will give you the current path, without any GET data.
I think.

$_GET['REQUEST_URI'] will give you the full URI, including any GET data.

--
Larry Flynt for Governor!
Bringing dignity back to the Governor's Mansion

Terry Austin
ta*****@hyperbooks.com
http://www.hyperbooks.com/
Jul 16 '05 #2

"Ralph Freshour" <ra***@primemail.com> wrote in message
news:21********************************@4ax.com...
I've been looking thru my PHP functions and can't find what I need -
is there a function that will tell me what .php file is currently
executing?

Thanks...


$_SERVER['PHP_SELF'] is just one of a number that could tell you what you
want... A whole host of other interesting values are available if you just
call phpinfo(); and check the output (which is in a nice clean table). Note
though that some variables are sent by the client (browser) and not all
clients (browsers) send the same amount of data (ie some reveal more
information, others don't - and some (like me) who have Norton Internet
Security 2003 have some of the headers sent by the client removed before
they hit the server (meaning minimum amount of data).

But if its just findiing out about server side values, then you should/can
rely on phpinfo(); to help you out.
Jul 16 '05 #3

"Ralph Freshour" wrote: I've been looking thru my PHP functions and can't
find what I need -
is there a function that will tell me what .php file is currently
executing?


$_SERVER['PHP_SELF'] is the 'parent' script you are executing. If you
include several files into it, $_SERVER['PHP_SELF'] would still be the
same.
If you need the filename of included files into themselfs, use __FILE__.
Jul 16 '05 #4
Ralph Freshour <ra***@primemail.com> schrieb:
I've been looking thru my PHP functions and can't find what I need -
is there a function that will tell me what .php file is currently
executing?


Use the function phpinfo() and have a look at all those variables at the
end of the page. You might get some more ideas about your task. :-)

Matthias
Jul 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: S.W. Rasmussen | last post by:
With the risk of being accused of multi-posting I would like to draw the attention to a serious visual basic/windows issue discussed in the microsoft.public.vb.bugs newsgroup. As pointed out below...
11
by: hokiegal99 | last post by:
How would I determine if a filename is greater than a certain number of characters and then truncate it to that number? For example a file named XXXXXXXXX.txt would become XXXXXX fname = files...
4
by: Michael | last post by:
All, I'll asked a question but I was not detailed (clear) enough for people to help so I'll retry. I have a cgi script pass a variable from one page to the next. The 'receiving' page replaces...
10
by: Brian Gruber | last post by:
Hi, I'm looking for a way to rename a whole directory of files in short order. The files in the directory have different lengths, however all of them end with _xxxx the x's represent a randomly...
8
by: Lad | last post by:
Hello, what is a way to get the the extension of a filename from the path? E.g., on my XP windows the path can be C:\Pictures\MyDocs\test.txt and I would like to get the the extension of the...
12
by: IamIan | last post by:
I searched the archives but couldn't find anyone else with this problem. Basically I'm grabbing all ASCII files in a directory and doing geoprocessing on them. I need to calculate a z-factor based...
4
by: B Squared | last post by:
I'm trying to pass a filename (which is a jpeg image) to a php function / file so that it will display. I know that its simple to get PHP to display an image hardcoding in the filename. For...
10
by: Steve | last post by:
I am trying to create a downloader which will bypass the saveas box in the WebBrowser control. I have the file downloading, but I don't know what the filename is that is being passed through the...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
12
by: vj | last post by:
I am using Borland C++. I run a program which generates output data files, say 'Voltage.dat', 'Current.dat'. I have a variable in my code (say N), and for various values of N (for each value of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.