Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 3 of 3
  1. #1
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    File upload form, Please help?

    Well I have a basic PHP file upload form and I want to know what the code (html and php) is for displaying the url to the uploaded file in a code box when the upload is complete.

    Any help is greatly appreciated.

  2. #2
    Japanologist Wilio's Avatar

    Join Date
    Dec 2005
    Location
    Somewhere in time
    Posts
    5,561

    Re: File upload form, Please help?

    Let's assume that your filename is $filename and your folder directory is files, then it will be logic to say that the file location is files/$filename. So create a variable named $dir

    Code:
    $dir = 'files/'.$filename;
    so now to show the location of the uploaded file

    Code:
    echo 'http://wwww.yourfullwebsiteurl.com/'.$dir;

  3. #3
    KTU
    KTU is offline
    Dedicated Member
    Join Date
    Mar 2006
    Location
    yes plz
    Posts
    805

    Re: File upload form, Please help?

    To make it show up in a box, just echo an input element with the value of the file path.

    Code:
    echo '<input type="text" value="'.$filepath.'" />';
    [center:36nrfcqg][/center:36nrfcqg]


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •