Page 1 of 1

php path

Posted: Fri May 08, 2009 5:43 pm
by ilovedoingwebsites
Hello everybody,

I am sorry but I am so new to this but I have a question.

How do I find the path to a particular folder?

I have a script that needs the path to the folder, it says in the instructions:

1. Edit includes.php and add the following lines:

Code: Select all

 
$uploadpath = "/var/www/vhosts/sitename.com/httpdocs/uploads/";
 
You will need to change $uploadpath to a directory that you create for file uploads. On Unix CHMOD this directory to 777. On Windows, the path may look like $uploadpath = "C:/Inetpub/wwwroot/sitename.com/uploads/"

so I don't know the path to the uploads folder.

THank you very much!!! :D

Re: php path

Posted: Fri May 08, 2009 5:50 pm
by mdk999
Depending on your setup .. you can add ..

Code: Select all

 
echo dirname(__FILE__);
 
in a php file in the root of your website and it should tell you the path to that file. You can then make a folder called 'uploads' in the webroot and then you just append that to the path..

Re: php path

Posted: Fri May 08, 2009 6:02 pm
by ilovedoingwebsites
this is my code and I have a white page with nothing

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<?php
# echo dirname(__FILE__);
?>
</body>
</html>

Re: php path

Posted: Fri May 08, 2009 6:05 pm
by ilovedoingwebsites
Sorry I make it work, but the path doesn't give me the drive like "d:// etc etc etc"

I have this only:

/home/content/l/o/c/locolacayote12/html/adobe

Re: php path

Posted: Fri May 08, 2009 6:08 pm
by mdk999
That is because you are on a *nix system and there is no C:\ or D:\ glad you got it working ..

Re: php path

Posted: Fri May 08, 2009 6:13 pm
by ilovedoingwebsites
thank you and I am sorry for such a simple question but I am on my diapers here

Mauricio

Re: php path

Posted: Fri May 08, 2009 6:19 pm
by mdk999
That's what the forums are for .. so don't feel bad .. just ask away ;)