retrive image using php ['HELP']

Discussion in 'PHP' started by minhazikram, Jan 5, 2012.

  1. #1
    Hello. I am having problem in retrieving image name in text area from database.

    suppose i have a code like :

    <td>Picture</td><td><input type="file" name="photo" value = "<?php echo "<img src=\"http://localhost/test/uploads/".$getmodelbyid['picture']."\">"; ?>" ><td>

    isint this suppose to retrieve the image file name and show in the text area?

    I know that using type="text" i can easily retrieve the image name. But i want to retrieve it in type="file" as it is easier for me to edit or change the image.

    If it is possible please help me to do it.

    Thankyou
     
    minhazikram, Jan 5, 2012 IP
  2. gherca

    gherca Member

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #2
    You can`t put on type="file" value !, try to make on first <input type="file" name="photo"> and <Br/><img src=""> to show .
     
    gherca, Jan 5, 2012 IP
  3. dujmovicv

    dujmovicv Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    4
    Trophy Points:
    48
    #3
    Where is the mentioned 'textarea' ? You don't use html 'input' tag to 'retrieve' something. If you want to show the image you should use
    
    <img src='path_to_img' title='image_title' alt='alt_text' />
    
    Code (markup):
     
    dujmovicv, Jan 6, 2012 IP
  4. vikasvyas

    vikasvyas Greenhorn

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    Put only image name like $path.$getmodelbyid['picture'] into input type file's name that will show your file's name and path and use img src for the showing image
     
    vikasvyas, Jan 9, 2012 IP