Page 1 of 1

need help in .string manuplation

Posted: Mon Aug 29, 2005 1:09 am
by itsmani1

Code: Select all

$temp =  $_SERVER['PATH_TRANSLATED'];
	echo stripslashes($temp);
I tried the above code and found following results.
-------------------------------------
c:\apache\htdocs\root\str.php
c:\apache\htdocs\abc\str.php
c:\apache\htdocs\test\str.php
c:\apache\htdocs\str.php
--------------------------------------
now i wanted to check wheather \root\, \abc\, \test\ exists or not ?
I mean to say is :
if the sub folder exists or not and if it exists whats its name?

help me plz.

Tahnx.
Mannan.

Posted: Mon Aug 29, 2005 1:13 am
by feyd
are you asking about finding what directories are under a know one?

Posted: Mon Aug 29, 2005 1:19 am
by itsmani1
yeah exectly i wanted to know the dir.

thanx.

Posted: Mon Aug 29, 2005 1:22 am
by feyd

Posted: Mon Aug 29, 2005 1:22 am
by itsmani1

Code: Select all

$_SERVER['REQUEST_URI']
in this way i can fine some thing like this.

/abc/root/index.htm
/abc/root1/index.html
/root/index.html

but how can i fetch root form it.
i want to fetch root, root1 etc.

.......
Mannan.

Posted: Mon Aug 29, 2005 1:28 am
by feyd
REQUEST_URI doesn't tell you what folder to look under.
PATH_TRANSLATED and DOCUMENT_ROOT can tell you, but you have to pull the directory out using dirname()

Posted: Mon Aug 29, 2005 1:37 am
by itsmani1
can you plz. tell me how i can get current directory sing
$_SERVER['PATH_TRANSLATED'];


thanx.
Mannan.

Posted: Mon Aug 29, 2005 1:39 am
by feyd
I did.

Posted: Mon Aug 29, 2005 2:02 am
by itsmani1
feyd wrote:I did.
can you pzl. help me out man?

---------------
Mannan.

Posted: Mon Aug 29, 2005 2:03 am
by feyd
read. the. post.
feyd wrote:REQUEST_URI doesn't tell you what folder to look under.
PATH_TRANSLATED and DOCUMENT_ROOT can tell you, but you have to pull the directory out using dirname()

Posted: Mon Aug 29, 2005 2:10 am
by itsmani1
Thanx. feyd .....
its working......

Thanx again ....
Mannan.