Results 1 to 2 of 2

Thread: Document selection then view

  1. #1
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Document selection then view

    Hi!

    As I am starting to enjoy the benefits of php, I'm still a grand newbie at it.

    So I'm trying to make/ searching for a script that can let me choose from a list, defined by a <select>-tag, and then click a button to open it.

    Is there any way of doing that, so that it won't be neccesary to update a list every day, if new documents has been uploaded ?

    The script I'm working on looks like this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> LA-MEDIA </TITLE>
    <META NAME="Generator" CONTENT="Editor">
    <LINK href="k.css" rel=STYLESHEET type=text/css></head>
    <BODY>
    <?
    include("config.php");
     echo $title; ?><img src="/media/logo.gif">
    <br>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr> 
        <td width="50%"> 
          <form name="form1" method="post" action="">
            Vælg musik:<br><select name="srcfile">
              <option value=''> 
              <? 
    $Open=opendir("$vidir"); 
    While ($Files=readdir($Open)) { 
    if(strstr(strtolower($Files),".wpd" )|| strstr(strtolower($Files),".txt" )|| strstr(strtolower($Files),".doc" ))  { 
    print("<option value='$dir$Files'>$Files"); 
    } 
    } 
    ?>
            </select><br><br>
            <input type=submit value="Læs Dokument" name="submit">
          </form>
    <a href="/media/uploadform1.php">Upload en fil</a><br>
          
    </table>
    
    </BODY>
    </HTML>

    There's something wrong in the script, I just can't see it...

    Anyone ?

    SP

  2. #2
    Join Date
    Oct 2005
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> LA-MEDIA </TITLE>
    <META NAME="Generator" CONTENT="Editor">
    <LINK href="k.css" rel=STYLESHEET type=text/css></head>
    <BODY>
    <?
    include("config.php");
    echo $title; ?><img src="/media/logo.gif">
    <br>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="50%">
    <form name="form1" method="post" action="">
    Vælg musik:<br><select name="srcfile">
    <option value=''>
    <?
    $Open=opendir("$vidir");
    While ($Files=readdir($Open)) {
    if(strstr(strtolower($Files),".wpd" )|| strstr(strtolower($Files),".txt" )|| strstr(strtolower($Files),".doc" )) {
    print("<option value='$dir$Files'>$Files");
    }
    }
    ?>
    </select><br><br>
    <input type=submit value="Læs Dokument" name="submit">
    </form>
    <a href="/media/uploadform1.php">Upload en fil</a><br>

    </table>

    </BODY>
    </HTML>
    i think it won't submit ...
    i haven't tested it yet ..

    type (action=value) or (onsubmit=value) at least
    u can leave it empty ..
    but u gotta type the action (onclick) on the submit button

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •