Hi, I am working on file uploads and I ened to save the new photo location in a database. So what i want to do is, move the file one folders up, and then make that an absolute URL to save into the database. Example: Current Page: site.com/photos/upload/photo.php Where I want the photo to go: site.com/photos What I want saved to the database: site.com/photo/photo.jpg
Oh sorry, i wanted it to be able to used on more than one site of mine, thats why I can't specifically set the URL, I need the script to do that based on the current URL
Ahh, you could: Create a config variable for the user photo path (full server path) Use this: $photo_path = $_SERVER['DOCUMENT_ROOT'].'/photos'; Try relative pathing: ../../photos (etc.)
Ok, so if my page is: http://site.com/upload/photo.php And I do $_SERVER[SCRIPT_FILENAME] it returns something like: home/fawfw/awfawfaw/fwaaf How do I get the actual url like: http://site.com/upload/photo.php