how to display a chosen image if an user forgets other information in a form?

Discussion in 'PHP' started by 123GoToAndPlay, Oct 13, 2006.

  1. #1
    For regular input fields I use
    
    <input name="checkEmail"  type="text" value="<?php echo $_POST['checkEmail'];?>" maxlength="255" />
    Code (markup):
    But for an image upload this doesn't work
    
    <input type="file" name="photo" id="file" value="<?php echo $_POST['photo'];?>"/>
    
    Code (markup):
    How do I set input field photo to the chosen file path???
     
    123GoToAndPlay, Oct 13, 2006 IP
  2. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That will never work.

    I suggest you research how file uploading is actually carried out. For one thing, the client-side file path is never sent.
     
    penagate, Oct 13, 2006 IP
  3. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    hi 123GoToAndPlay,

    as what penagate said it wont work. As a suggestion try to look at this resource:

    http://www.blazonry.com/scripting/upload-size.php

    let us know your progress :),

    thanks,

    gigamike


     
    gigamike, Oct 13, 2006 IP
  4. intoex

    intoex Peon

    Messages:
    414
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    <input name="checkEmail"  type="text" value="<?php echo $_POST['checkEmail'];?>"
    
    Code (markup):
    it's wrong - you need to analize and convert you post variabled.
    Some symbols will be quoted and you will got an error.
    For image create tmp file and make a link to it, and keep in session about downloaded file also.
     
    intoex, Oct 13, 2006 IP