Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Upload images

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #45748
    austinnnnn
    Participant

    I need some help. I have my website, wich will have a backoffice to insert data, and a front end that will do some querys to databse.

    I want to be able to upload images when i insert a new data. here is the form, here i want to upload images:

    http://i.imgur.com/jKYjxl4.jpg

    But i want the images to be stored in a folder, not in the database. Like images/$id

    So when i enter a new data, it will create a folder with the id of the data i insert on the database, and upload the images to there. Other thing i want is to upload several images, so i upload one, and when that field already have a image, it will display another field so i can upload more.

    Then when i display them, i want to display like a thumbnail for the first image i insert, and then when i click, the image will be displayed in real size, and i can click and nagivate to the others, like a galery. So i think the best is to resize the images to 800×600 and create a thumbnail to the 1st one i guess.

    Can someone help me?

    #139937
    Paulie_D
    Member

    What have you tried so far.

    You can’t just state a bunch of requirements and expect us to do all the work for you.

    Are you using a CMS?

    If not, have you though about using one?

    #139944
    Kitty Giraudel
    Participant

    > But i want the images to be stored in a folder, not in the database. Like images/$id

    This is common sense. You do not store images in a database, you store paths.

    #139956
    austinnnnn
    Participant

    No im not using CMS. This is for the final project of my course, i cant use cms, since if i use it, i just would have to install plugins and my work was done ..

    #139957
    Paulie_D
    Member

    Then I repeat…

    >What have you tried so far>

    >You can’t just state a bunch of requirements and expect us to do all the work for you.

    #140140
    austinnnnn
    Participant

    can someone give me a good tutorial so i can start to make? like upload images to a folder. i cant find any good

    #140143
    Kitty Giraudel
    Participant
    #140416
    austinnnnn
    Participant

    So i was working on this, and the images are uploaded, the many i select, they go for the folder. but only the path of one is stored on the bd. So what i want to do is like, everytime i insert a new place, that will contain several images, i want it to create a folder with the id of the place, and all the images will go into to the folder. so only the folder path will be stored in db, and when i list a place, i will get all the images of that place.

    like:

    images/place1 (but not place1, just the id of the place)
    images/place2

    This is what i got for now:

    http://codepad.org/w8lKpJKt

    #140392
    Kitty Giraudel
    Participant

    I’m not sure this forum is the best way to display some PHP code. Why don’t you try http://codepad.org/ ?

    #140500
    austinnnnn
    Participant

    nobody?

    #140501
    Kitty Giraudel
    Participant

    If no mistake `move_uploaded_file` creates path if it doesn’t exist. So if you want to move the file to a folder that doesn’t exist, the function will create it and drop the file in.

    #143666
    saeed55sd
    Member

    $dir = ‘myDir’;
    if ( !file_exists($dir) ) {
    mkdir ($dir, 0777);
    }

    #143783

    nice discussion

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.