upload file issue



First of all I am rather new into PHP. I use php 5 and I am putting together a web site for a local association I belong too.
Most of the site is okay, except for this problem :

I need to be able for the member of the site to upload files (gif, jpg or pdf). After reading a lot about the danger of file uploading, I decided to create a folder at the root of the web server. The upload of the files goes on without any problem, but when i tried to show some of the file (such as the image files), the system does not retrieve them.

Here is the the tree of my web server :
/.
/website (folder where all of the web site is build with *.php files)
/uploads
/images (folder where all the images files are uploaded)
/pdf (files where all the pdf files are uploaded)

The bit of code doing the uploads works fine, but I can not find a way to retrieve the files. When I code in the php file :
echo '<img src="../uploads/images/test.gif">';
The browser is in fact looking for a file name www.mywebsite.com/uploads/images/test.gif which of course does not exist.

I tried to look on the web for an answer but did not find one. Could any one points me out to a tutorial for this subject, or will be good enough to help with a solution, bearing in mind that I am by no mean an expert in php.

Thank you.
.



Relevant Pages

  • Re: Cannot find page- cgiemail
    ... This depends on your host server supporting PHP files ... index files folder which has all of the other files in it. ... i have even used my host's file builder to upload each file seperately ... where do i find out what extension my mailer has? ...
    (microsoft.public.publisher.webdesign)
  • Re: Chmod
    ... Jerry Stuckle wrote: ... still be able to create the folder in PHP from a web page (so it's running as ... you to be able to upload files through the website. ...
    (comp.lang.php)
  • Re: upload file issue
    ... together a web site for a local association I belong too. ... create a folder at the root of the web server. ... The upload of the files ... /website (folder where all of the web site is build with *.php files) ...
    (comp.lang.php)
  • Re: Chmod
    ... still be able to create the folder in PHP from a web page (so it's running as ... JDS Computer Training Corp. ... you to be able to upload files through the website. ...
    (comp.lang.php)
  • Re: [PHP] Uploading into website directory for Php files
    ... How do I upload the include files into my Include ... upload the file into that include folder which is .:/include:/usr/ lib/php ... Sent from the PHP - General mailing list archive at Nabble.com. ... I'm not sure if they are chrooting something or if it's one of the base_dir things, but your web root is your root so you don't have access to /usr or anything else on the servers file system. ...
    (php.general)