Existing file name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derek @ Blueyonder

    Existing file name

    Hi

    I am retrieving a fielname for a picture in PHP/MySQL and would like the
    existing filename that is being retrieved from the database to be shown in a
    file input. How do I do this please?

    If I simply use a value statement nothing is shown even though I know the
    variable holds the correct value.

    The code I am using is


    $picture1filena me = $myrow[4] ;
    echo " myrow[4] in form " . $myrow[4] . "<br>";
    echo " picture1filenam e in form " . $picture1filena me ;
    echo ("<td colspan='2'><in put name='picture1' type= 'file' size='80'
    value= '$picture1filen ame'>");

    The echos are just there to show that the correct value has been found.

    Any help would be appreciated.


    Many thanks


    Derek



  • Rik

    #2
    Re: Existing file name

    Derek @ Blueyonder wrote:
    Hi
    >
    I am retrieving a fielname for a picture in PHP/MySQL and would like
    the existing filename that is being retrieved from the database to be
    shown in a file input. How do I do this please?
    It's a security issue, you can't set the value of the file input.
    What would stop you to make it a hidden input and enter a name usually found
    in an OS containing private information?

    If it's a file that's on your server, just use a text-input, and act
    accordingly after posting the form.

    Grtz,
    --
    Rik Wasmus


    Comment

    • Derek @ Blueyonder

      #3
      Re: Existing file name

      >I am retrieving a fielname for a picture in PHP/MySQL and would like
      >the existing filename that is being retrieved from the database to be
      >shown in a file input. How do I do this please?
      >
      It's a security issue, you can't set the value of the file input.
      What would stop you to make it a hidden input and enter a name usually
      found
      in an OS containing private information?
      >
      If it's a file that's on your server, just use a text-input, and act
      accordingly after posting the form.
      >
      Grtz,
      --
      Rik Wasmus
      >
      >
      Hi

      Thank you for your reply.

      I have done as you suggested and it works fine.

      Many thanks


      Derek


      Comment

      • Alvaro G. Vicario

        #4
        Re: Existing file name

        *** Derek @ Blueyonder escribió/wrote (Wed, 12 Jul 2006 09:32:49 GMT):
        I am retrieving a fielname for a picture in PHP/MySQL and would like the
        existing filename that is being retrieved from the database to be shown in a
        file input. How do I do this please?
        Most browsers won't allow that. There's a famous one that does but I cannot
        recall which one (Konkeror maybe?).

        --
        -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
        ++ Mi sitio sobre programación web: http://bits.demogracia.com
        +- Mi web de humor con rayos UVA: http://www.demogracia.com
        --

        Comment

        Working...