Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member lonepine's Avatar
    Join Date
    Sep 2003
    Posts
    14
    Member #
    3176
    I am completely new to PHP and MySQL and I have a great deal of learning to do before I get to the stage that I am asking about here but I just want to know if it is theoretically possible before I start doing all the research I need to do for my site.

    What I want to do is an HTML/JavaScript form that allows a user to upload a thumbnail and large picture (both same). The thumbnail should hyperlink (HTML) to the large pic.

    To sum up: the user uploads a thumbnail with a hyperlink to a big pic also uploaded at same time to MySQL database.

    I know (in theory!) that it is possible to upload the pics I am really just wondering if it is possible to do the hyperlink between the 2 pages.

    Phew, clear as mud there.

    Thanks
    Lpine

  2.  

  3. #2
    Senior Member [Li] Brad's Avatar
    Join Date
    Oct 2003
    Location
    Saskatoon, Canada
    Posts
    578
    Member #
    3689
    You might try to save the hyperlink info with the thumb and when outputting the picture just format it with HTML, that should give you the hyperlink, though I'm not very familiar with MySQL so maybe someone else knows of a solution.

    [Li] Brad
    "Art strives for form, and hopes for beauty." - George Bellows

  4. #3
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    you want an image gallery? if you are I suggest http://www.4homepages.de/

  5. #4
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    137 times
    It sounds like you wish to store a thumbnail and a link on your site, but the link points to the big pic on someone else's site? Either way, storing the pic and link is easy, as well as referencing them both. Having users upload it is a tad more complicated. Not quite sure how to do it, but it's obviously possible, as our avatars are done in this exact same way.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  6. #5
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    To sum up: the user uploads a thumbnail with a hyperlink to a big pic also uploaded at same time to MySQL database.
    I assume you want to store both the thumbnail and the big pic on the same site.

    From what I've read (and tested out myself), it's strongly recommended NOT to store images in the MySQL DB itself. The images are huge chunks of binary data, that slows down your DB considerably. Especially if you start to delete images from the DB, it will leave big holes and aggrevate the problem.
    What you should do is upload the images to two separate folders where the thumbnail and big pic has the same name:

    /images/uploads/thumbnails/some_name.jpg
    /images/uploads/some_name.jpg


    Then you pass the name of the image to the DB. While writing its name to the database, you can either wrap som HTML <a href> tags with the name to be stored in the DB, or you can can wrap that HTML code around the variable (some_name.jpg) when you extract it from the DB.

    If you wrap it in this code(as an example):

    Code:
    <form name="whatever" method='post' action='foldername/show_big_pic.php'>
    <input type="hidden" name="picture" value="some_name.jpg">
    <input name="submit" type="image" src="images/uploads/thumbnails/some_name.jpg">
    </form>
    You would display a thumbnail that would be clickable and pass the picture name to the "show_big_pic.php" that would contain the right path to the folder containg the big pics, and some HTML to to display the big pic in a framework of your taste.
    S. Rosland

  7. #6
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    137 times
    Personally, I'd add _TN to the thumbnail pic, just for clarification. You would only need to store the base part of the name, i.e. some_name, and then you could add the _TN in the normal HTML Code.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:43 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com