How do you get the name of the directory you are currently in?
I tried get CWD or whatever it is, but it gave me the long, full path...I just want the name of the directory.
The reason I am asking is because I have finally solved my forwarding problem when people are not logged in but it does something rather strange.
For example, if the $redirect variable has "/members/hello.php" in it, when I use the following code it only uses the "hello.php" section and gets rid of the "/members/" bit.
$nextPage = isset($_POST["redirect"]) ? basename($_POST["redirect"]) : 'welcome.php';
header('Location: '.$nextPage);
exit;
It's annoying because what it returns from the header is the url:
http://www.myurl.net/hello.php
I want it to return:
http://www.myurl.net/members/hello.php
Any ideas?