469,282 Members | 2,000 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

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 4319
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Danny Anderson | last post: by
1 post views Thread by Vijay | last post: by
2 posts views Thread by Kathy Burke | last post: by
reply views Thread by Anonieko Ramos | last post: by
8 posts views Thread by Evan | last post: by
1 post views Thread by Jamey McElveen | last post: by
reply views Thread by =?Utf-8?B?Tmljaw==?= | last post: by
1 post views Thread by michal.podlewski | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.