Jump to content

Get current directory - only part the user sees.


jeff5656

Recommended Posts

I have a page site.com/register/signup.php

 

I want to echo out the current directory:  register.

 

When I use getcwd() I get:

 

/home/user1234/public_html/register

instead of:

register

 

or if I am inside this directory  site.com/register/image/

then I want to echo out:

register/image

 

I have also tried the server[self] command but that too gives you the full directory.  Does anyone know how to echo out only the current directory starting AFTER the public_html?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.