where to find absolute path?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cooler75
Forum Commoner
Posts: 40
Joined: Wed May 29, 2002 2:43 pm
Location: RichIsland

where to find absolute path?

Post by cooler75 »

hello,
i am still working on an uploading script, and would like to find out few things here:

1. my script would allow me to upload a script to a server directory, like say now i created a dir called images, what would be the absolute path to the images folder?

2. what is the easiest way to get the full path to the dir? when i used my files thru CuteFTP, i see something like 'var/www/html/test/images', is that what i use for path? but my script didnt work when i used that.

:oops:
thank you
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

use this

Post by phpScott »

save this as a .php file , upload, and run this script. It will tell you.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>root</title>
</head>

<body>
<?
   $root = getenv("DOCUMENT_ROOT");
   echo "root: ",$root,"<br>\n";
?>


</body>
</html>
phpScott
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

'var/www/html/test/images' should have been
'/var/www/html/test/images' if that is the correct path
Post Reply