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

Self location....

Hi!

Is there are way, so I can retrieve the filename being runned and/or
its location?

Currently it is C:\Inetpub\wwwroot\JOTIntranet\modules\helloworld\ but
that might change. I need to create some temporary files in the same
catalog.

Jul 18 '06 #1
4 4560
You can use __FILE__

"Sonnich" <so************@elektrobit.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Hi!

Is there are way, so I can retrieve the filename being runned and/or
its location?

Currently it is C:\Inetpub\wwwroot\JOTIntranet\modules\helloworld\ but
that might change. I need to create some temporary files in the same
catalog.

Jul 18 '06 #2
Sonnich wrote:
Hi!

Is there are way, so I can retrieve the filename being runned and/or
its location?

Currently it is C:\Inetpub\wwwroot\JOTIntranet\modules\helloworld\ but
that might change. I need to create some temporary files in the same
catalog.
$_SERVER["SCRIPT_FILENAME"] usually reveals the full path of the
current script on the server. Combined with dirname(), you can find the
location of the directory the script is located in.

Also, getcwd() will return the current working directory.

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Jul 18 '06 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sonnich wrote:
Is there are way, so I can retrieve the filename being runned and/or
its location?
Run phpinfo(), have a look at the different $_SERVER[] variables.

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Now listening to: Yuki Kajiura - Noir Original Soundtrack, Volume 1 (2001) -
[3] Snow (2:11) (94%)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEvQCb3jcQ2mg3Pc8RAjRrAKCDNxl7VJe6SRgMidVvoM ytfq/0FQCeNZ1b
Xv8Njks+ZKh99Y4ft1Fhy2I=
=yO2G
-----END PGP SIGNATURE-----
Jul 18 '06 #4
Thanks, dirname(__FILE__) did the job

Hans 'pritaeas' Pollaerts wrote:
You can use __FILE__

"Sonnich" <so************@elektrobit.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Hi!

Is there are way, so I can retrieve the filename being runned and/or
its location?
Jul 19 '06 #5

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

Similar topics

1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
1
by: Vijay | last post by:
Hi Can anybody explain what self::* means in Xpath. I understand that "self" means the context node itself and * means any node type. So I thought self::* meant all the child nodes of context,...
18
by: Ralf W. Grosse-Kunstleve | last post by:
My initial proposal (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't exactly get a warm welcome... And Now for Something Completely Different: class autoinit(object):...
2
by: Kathy Burke | last post by:
Hi, could have sworn I used this before and don't understand why this isn't working? I have a button with onclick event: do some database updates, etc. then, open a new window (a...
0
by: Anonieko Ramos | last post by:
Self Installing Service Enter a topic name to show or a new topic name to create; then press Enter .. Start by writing a service. This involves deriving a class from...
4
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm //...
8
by: Evan | last post by:
Hi I have a short script that makes 2 calls to methods in another script as follows: import canPlaces as canp callOne=canp.addMe(3,5) callTwo=canp.estocStn()
1
by: Jamey McElveen | last post by:
Another quick question. I have seen applications like Reflector that can perform a self update. How can I replace the currently running executable with another file downloaded from an update...
0
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hi, I have a problem with the expiring self signed certificate on our server. Warning Event IDs 12017 and 12018 occuring every few minutes in the Application Event viewer. I have run the...
1
by: michal.podlewski | last post by:
Hi All, I have a problem with a simple (as I thought till now) thing: I want to make a link in a child-window which would change site in the parent-window and along with closing child window. The...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.