How "GET" a image source onto a textbox value?

Discussion in 'PHP' started by cuze, Jul 17, 2011.

  1. #1
    Hi everyone!
    I got a problem on how to get a image source to a textbox.For Example say there is "THEVALUE.html" and "VALUEGETER.php". and the "THEVALUE.html" has an image with a source : "images.png" now i need the "VALUEGETER.php" load the image source in the "VALUEGETER.php"'s textbox value. How i do that?
     
    cuze, Jul 17, 2011 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    The first part is pretty easy. You read the image file with a function like fread() or file_get_contents(). Displaying that information in a textbox is a problem because the image file contains binary data and the textbox is only designed to display text.

    It all depends on why you want to do this. Editing the image file's binary data in a textbox would be possible, although cumbersome, and you could easily corrupt the data in the process. If you just want to be able to edit some meta data in the image file, I would suggest that your script extract that meta data for your textbox and only edit that information. Good luck!
     
    rainborick, Jul 17, 2011 IP
  3. cuze

    cuze Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thankyou for reply.
    i just want the source of the image in a textbox.

    EDIT----------------------------------------

    the image is in a html and i want to get from the html's image source. what i know is the html's image name. i need something like (GET "\htmlfile.html' "imageID.src" = mybox.value")
     
    Last edited: Jul 21, 2011
    cuze, Jul 21, 2011 IP