Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the current directory ? 1

Status
Not open for further replies.

maverick

MIS
Apr 21, 1999
193
US
Hello all !

How do I get the current directory ?

so I can make my code a little more dynamic

Thanks

"Hacker by Heart"
saenzcorp@hotpop.com
 
ok, this gets me the path

getcwd()

But it appears to be a dos path and not a web path,

Now how do I remove everything I don't need ?

trim it ?

"Hacker by Heart"
saenzcorp@hotpop.com
 
Thanks ,
thats what I needed !



"Hacker by Heart"
saenzcorp@hotpop.com
 
OK, now I just need to trim off the file name...

this is what I got so far:
<?php
$result= $_SERVER['PHP_SELF'] ;
$result = rtrim($result, ' ???? ') ;
echo $result ;
?>

it give me this:
/directory/filename.ext

But I need to trim off the filename.ext

any ideas what to replace ???? with to acomplish this ?

tia

&quot;Hacker by Heart&quot;
saenzcorp@hotpop.com
 
Thanks !

I read that and now have:
/directory

and that I can deffinatly work with !

Thanks for your help !!!!
You Rock !

I have another Q but I will post out of this topic

This topic is solved !
thanks to sleipnir214

:)

&quot;Hacker by Heart&quot;
saenzcorp@hotpop.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top