473,385 Members | 1,553 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,385 software developers and data experts.

How to get the filename of a called PHP script

I'd like to get the filename of a called PHP script.
E.g. if you call
http://www.test.com/subdir/start.php
I'd like to get within the PHP script 'start.php' the name 'start.php'.

I've several PHP scripts and of course I could add at the beginning of each
PHP script the name of the PHP script itself. But if there's a possibility
to read its name from the filename I'd prefer this method.

Stefan
Feb 26 '06 #1
2 1573

Stefan Mueller wrote:
I'd like to get the filename of a called PHP script.
E.g. if you call
http://www.test.com/subdir/start.php
I'd like to get within the PHP script 'start.php' the name 'start.php'.

I've several PHP scripts and of course I could add at the beginning of each
PHP script the name of the PHP script itself. But if there's a possibility
to read its name from the filename I'd prefer this method.

Stefan


One of these has what you want:
<http://www.php.net/reserved.variables>

Feb 26 '06 #2
> One of these has what you want:
<http://www.php.net/reserved.variables>


Great, many thanks
Stefan
Feb 26 '06 #3

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

Similar topics

7
by: Kornelius Finkenbein | last post by:
Hello folks! I've got a strange problem with my download-script in conjunction with M$ internet explorer, if the filename I want to link to includes more than one points. In Netscape the problem...
3
by: Shawn Wilson | last post by:
Hi, I've created a PHP file called filename.jpg. It outputs a JPG. I've set up a .htaccess file to force the filetype to PHP. The file is displayed in a page on a browser. I cannot get the...
1
by: hokiegal99 | last post by:
I've written a small script (with much help from this list) that searches through a directory for files without a PC filename extension like .doc .xls and then adds them. The reason for writing the...
0
by: Neil Benn | last post by:
Hello, I'm writing a simple cgi script and want to be able to access the filename in a FieldStorage file instance. I have successfully manmaged to access the file as a 'file-like object' by...
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...
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...
0
by: Edge1960 | last post by:
I am using Visual Web Developer along with SQLExpress on a WinXP Pro 2002 SP2 machine with a 3.79 GHz processor with 2GB of RAM to create a web application for entering data to a database. I am...
0
by: Ofelia | last post by:
Hi, I'm new to this forum and to Perl language but I would like to ask for your help. I'm working in Linux and the files I need to process are in the format “file.gz”. I created a script which...
3
by: Adam Nielsen | last post by:
Hi all, Does anyone know how you can get a filename if all you've got is the resource (e.g. returned by fopen())? The reason I ask is that I'd like to use tmpfile() to create a temporary file...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.