PHP Gallery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Faree

    #1

    PHP Gallery

    Hi,

    I am a PHP Developer.can any one help me on image upload and
    display of that image.what i want is uploading an image to a
    directory ,displaying of that image as a thumbnail.when i click on
    that image the image should be diplayed in another page.

    I wrote code for image uploading and as well as display code.but i
    couldn't write image resizing when click on that.:(

    can anyone come up with code for this ,
    asap.Otherwise suggest me a way how to get this.

    Thanks.

  • fipaj1992@gmail.com

    #2
    Re: PHP Gallery

    Hi!
    <?php
    /*
    * add.php
    * Plik, za pomoca którego mozemy dodac obrazki do galerii
    * @author Filip Fipaj Konarowski <fipaj1992@gmai l.com>
    * @todo Sprawdzenie, czy plik jest obrazkiem; opisy + MySQL
    */
    ?>
    <form enctype="multip art/form-data" action="add.php " method="post">
    <input type="file" name="my_file">
    <input type="submit" name="sent" value="Dodaj obrazek!">
    </form>
    <?php
    if (isset ($_POST['sent'])) {
    /*
    * Sprawdzamy, czy formularz zostal wyslany
    */
    if (is_uploaded_fi le ($_FILES['my_file']['tmp_name'])) {
    /*
    * Sprawdzamy, czy plik byl juz uploadowany
    */
    $strUploadDir = 'img/' . $_FILES['my_file']['name'];
    /*
    * Folder, do którego beda zgrywane pliki
    */
    if (move_uploaded_ file ($_FILES['my_file']['tmp_name'] ,
    $strUploadDir)) {
    echo 'Udalo sie :)';
    /*
    * Upload pliku
    */
    include ('img.inc.php') ;
    resizeImage($st rUploadDir, 100, 100, 'little_img/'.
    $_FILES['my_file']['name']);
    /*
    * Tworzymy miniature
    */
    }
    else {
    echo 'Nie udalo sie :)';
    /*
    * Wyswietlenie komunikatu bledu
    */
    }
    }
    else {
    echo 'Nie udalo sie :)';
    /*
    * Wyswietlenie komunikatu bledu
    */
    }
    }
    ?>
    Delete comments; class to resize image you can find here:


    And learn polish :)

    Comment

    • Faree

      #3
      Re: PHP Gallery

      Hi fipaj,

      Thanks for u r code.[color=blue][color=green]
      >> And learn polish :)[/color][/color]
      Is there any thing wrong in my query? :( .If it is
      ,i am sorry.

      Comment

      • fipaj1992@gmail.com

        #4
        Re: PHP Gallery

        No, of course I'm joking :)

        Comments are in Polish, I'm from Poland i I code in this langauge only
        ;)

        Comment

        Working...