By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,542 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

Self location....

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
-----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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.