473,729 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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


Jul 16 '05 #1
4 23986
Ralph Freshour <ra***@primemai l.com> wrote in
news:21******** *************** *********@4ax.c om:
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

$_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*****@hyperbo oks.com
Jul 16 '05 #2

"Ralph Freshour" <ra***@primemai l.com> wrote in message
news:21******** *************** *********@4ax.c om...
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


$_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

$_SERVER['PHP_SELF'] is the 'parent' script you are executing. If you
include several files into it, $_SERVER['PHP_SELF'] would still be the
If you need the filename of included files into themselfs, use __FILE__.
Jul 16 '05 #4
Ralph Freshour <ra***@primemai l.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

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. :-)

Jul 16 '05 #5

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

Similar topics

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 by Norman Diamond the bug may result in loss of data when saving files with the standard common dialog control. Norman Diamond describes the problem as follows: ---------- In VB6 SP6, VB6 SP5, and possibly others, the common dialog box...
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 if fname > 6 print fname Thanks!!!
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 this variable (in this case %filename%) with whatever was passed. This works fine when the page is called from the cgi script because it has
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 generated number from a program that I saved from. So I need to find a way that I can quickly remove the underscore and the last 4 numbers from the filename without changing anything else. I can't set a max length to the file becuase the filename's...
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 filename, that is here txt I would like that to work on Linux also
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 on the latitude of the ASCII file being worked on, which is in the filename. If I type in the code manually it works and reads the latitude value from the ASCII filename, but when run within ArcGIS it crashes when it gets to int(LatString)....
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 example, an href to this: <?php header("content-type:image/jpeg"); $filename = "image_file.jpg"; $im=ImageCreateFromJPEG($filename); ImageJPEG($im);
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 stream. Is their a way to determine what the file name is so that I can execute the appropriate functionality of the extensions. The stream is created dynamically so I cannot capture the filename straight from the URL. Thanks STeve
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 encoding too, but with no success. Can someone provide details on how to handle the 2-byte char URLs and download the files? Appreciate your suggestions/help in resolving it. Here is my code:
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 N), I generate these output data files. After running the program once for a given value of N (say N equal to 1) and when the programme is finished, I manually append the generated filename with the value of N, such as 'Voltage_N1.dat',...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.