SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    special forms :)

    Hi all

    I know how to send a form with normal text stuff from things like radio buttons, text fields ect.

    I know how to send files through forms as well..

    But when I try to do it with the same form it screws up. Is it possible to send both through one form?

    thanx

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you probably forgot to add enctype="multipart/form-data" to your <form> tag. You must have this when uploading files through a form.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yup.. that worked!
    not that i doubted u
    Got another question on moving over files. All i can do is copy the image to wehre ever the script is being run from(the directory) How can I make the file go the a specific directory?

    thanx

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    simple let's say the file input is named userfile. In your script
    PHP Code:
    copy($userfile"/path/to/folder/".$userfile_name); 
    Where /path/to/folder/ is the actual physical location on the server of the folder you want to copy the image into. It needs to have 777 permissions as well to allow the web server write privs in it.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is the path relitive to the script copying the file.. or to the root of hte server?

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Relative from the server root. You can get the path by logging into your server with SSH cd in to the directory you want to upload files to and type pwd that will give you the full path if you don't already know it.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is there a quick tut I can read on ssh commands?
    i know how to go up the directory tree, but how do I go back? tried cd.. but I guess it aint like dos

    also Can I make a folder throug it as well?
    Last edited by slighltywhacked; Jul 31, 2001 at 15:58.

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cd ../ is how you do it in unix.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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