Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: crop picture

  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile crop picture

    Hello everyone,
    In fact, I have a script that makes the crop image that works well, I'm stuck on the part of adding a text box to allow to name the image "thumb".
    I also ask if possible to remove the "PHP_SELF" script and divide it into several pages.
    Attached script
    Attached Files Attached Files

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    If you have them upload the photo and a caption (or photo title) on a form,
    someplace, you have to save the caption and point it to the photo. That will
    require some sort of database (either plain text or MySQL).

    Do you have any databases already installed and you are using?

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    n fact I'm using a MySql database with PHP, and I have no problem in this side.
    When I make a text box to enter a name for the resized image.
    The easiest for me is to divide my script in several forms and removes the action = "<? Php echo $ _SERVER [" PHP_SELF "];?>".
    The problem is when I make a text box and I give a new name, it gives me always errors.

  • #4
    New Coder
    Join Date
    Apr 2009
    Location
    Georgia
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts
    are you wanting the text box to be the name of the uploadfile? or are you wanting a text box above the save button and name the save file?

  • #5
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Enter the name of 'thumb_image_name' in a text box:

    <form name="photo" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
    Photo <input type="file" name="image" size="30" /> <br /><br />

    Specify the name of 'thumb_image_name' <input type="text" name="thumb"><br /><br />

    <input type="submit" name="upload" value="Upload" /><br /><br />
    </form>





    After


    $thumb=$_POST['thumb'];
    $thumb_image_name = $thumb.".jpg";

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    oh, so you're wanting to rename the file that they are uploading?

    They pick the photo from their PC, and then type in a name,
    that name becomes the JPG filename ... is that correct?

  • #7
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    exactly

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    I have to ask why you would allow that?

    People could be entering all kinds of things that should not be in a filename.

    Maybe you want that textbox or "caption" to appear under the photo?
    Why are you making it the filename?

  • #9
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to allow me to rank my pictures by the following name

  • #10
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    Does rank mean "sort"?

    You want to be able to sort them alphabetically?

  • #11
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes exactly, but it later.
    now I'm doing a space admin to insert pictures with the name I want.

  • #12
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now I think you understand, is that you have an idea or a piece of code?

  • #13
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    That's why I asked about the database.

    Normally, when a file is uploaded, a row is added to the database
    that specifies the filename, some sort of ID, a description, a title, gallery number, etc.

    Your web pages use that database to display the photos.

    They could be sorted by ID, title, description ... etc.
    And you could specify which photos appear in which gallery.

    What is your website about, and what is the existing MySQL used for?


    .

  • #14
    New Coder
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can take care of this part, I just how to get a false name in the textbox and give this name to the image
    Thank you

  • #15
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,903
    Thanks
    15
    Thanked 226 Times in 226 Posts
    Quote Originally Posted by jacque99 View Post
    I can take care of this part, I just how to get a false name in the textbox and give this name to the image
    Thank you
    Why not just put the thumbnails in a thumbs folder? That would eliminate the renaming and make it easier to call them since they would have the same name as the original.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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