Getting file and dir as settings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sonnich

    Getting file and dir as settings

    Hi!

    I need to create a small settings window in PHP.

    I need to set options like
    1) an exe file
    2) directories (search path), one by one, output
    3) allowed users for certain items (string list)

    I found this:
    <input type="file" name="file" size="20" <? print("value=$m ergerprg2");
    ?>>

    but I cannot set the present file here - how do I do that?

    how do I select a directory?

    as for the string list I will try tomorrow...

    BR
    Sonnich

  • David Dorward

    #2
    Re: Getting file and dir as settings

    Sonnich wrote:
    I found this:
    <input type="file" name="file" size="20" <? print("value=$m ergerprg2");
    ?>>
    >
    but I cannot set the present file here - how do I do that?
    For security reasons, browsers do not allow websites to specify the
    value for file inputs (otherwise, for example, a site could specify a
    file containing sensitive data (such as passwords or credit card
    information) and then hide the input).
    how do I select a directory?
    Browsers provide no facility to select directories.

    Comment

    • Jerry Stuckle

      #3
      Re: Getting file and dir as settings

      Sonnich wrote:
      Hi!
      >
      I need to create a small settings window in PHP.
      >
      I need to set options like
      1) an exe file
      2) directories (search path), one by one, output
      3) allowed users for certain items (string list)
      >
      I found this:
      <input type="file" name="file" size="20" <? print("value=$m ergerprg2");
      ?>>
      >
      but I cannot set the present file here - how do I do that?
      >
      how do I select a directory?
      >
      as for the string list I will try tomorrow...
      >
      BR
      Sonnich
      >
      As David indicated, you can't select the directory or file information
      in PHP. However, you can use javascript to open a window browse for the
      file, then put the filename back into the input field.

      If you need more help, check comp.lang.javas cript.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      Working...