I am uploading a file with PHP and I have set the path of my upload directory as:
$uploadDirectory = '../../../../../misc/uploads/my_images/';
I am running php script from a path like: c:/wampp/htdocs/imagework/
the misc directory is in c:/wampp/htdocs/imagework/
How can I fetch the name of my root directory which is 'imagework' so that I will replace the path of $uploadDirectory. I don't want to use ../../../ etc
I need to get the name of my directory which is 'imagework'
I have tried $_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'] but it gives me the path of localhost not for the imagework directory.
Looking forward for help