PDA

View Full Version : Document selection then view



Silent Panther
10-17-2005, 12:09 AM
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:


<!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 :eek:

Black Label
10-18-2005, 02:16 AM
<!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