SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    upload browse delete photos on server

    Hello
    I have built a website for a client that contains 3 slideshows built with javascript. The qty of images in the javascript array is fixed -different in each slideshow. I am trying to build a simple CMS with PHP where she can browse in the different slideshow directories - select a photo -delete it and replace it with a new image.
    I have basic knowledge of PHP - can upload images etc. On the server there isn't any SQL DB .
    Any suggestions or script reccomendations would be greatly appreciated
    Katu

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Most PHP hosting packages out there come with a free mysql DB - contact support on their host, asking if the package came with one (most people don't even know).

    If you can't get access to one, there are some alternatives, but none as powerful. One would be an XML database - but again, MySQL and PHP are meant to be used together, hence why they work so efficiently.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah , thanks , just checked and no there isn't any sql DB with this package. I will check out some tutorials on how to create and use xml files with php. Hopefuly i'll get something working

  4. #4
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For about $4 a month, you can buy mysql hosting from a separate host. I found this like on google: http://www.hostdepartment.com/mysqlwebhosting/

    It would be worthwhile if you can get mySQL - again, PHP is made for it, and has better ways to add, retrieve and modifty data.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  5. #5
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx but am adding a basic CMS for a client who doesen't want to spend any more cash than they have to , so i just want to add this feature and sign off

  6. #6
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't need a DB if you are simply dealing with a photogallery - unless you want extras like text associated with each image. Look at using a simple php file manager to upload,edit and remove images, then all you need to worry about is the front end.

    The code below will pull files out of a directory, in ur case you might need to filter abit more to make sure it's an image but i'll leave that up to u.
    PHP Code:

            
    if ($dh opendir(PATH_TO_FOLDER)) { #  find all the files here..
                
    while (($file readdir($dh)) !== false) {
                    if (
    $file != '..' && $file != '.') {
                        if (
    is_file(PATH_TO_FOLDER.$file)) $filearray[] = $file;
                    }
                }
            }

                    
    print_r($filearray); 

  7. #7
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    For about $4 a month, you can buy mysql hosting from a separate host. I found this like on google: http://www.hostdepartment.com/mysqlwebhosting/

    It would be worthwhile if you can get mySQL - again, PHP is made for it, and has better ways to add, retrieve and modifty data.
    You can get $2 a month hosting from freehostia.com and comes with the full package, Its what I use as a playground, the servers aren't the fastest but it's quite good for what you pay.


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
  •