Hallo zusammen,
ich habe mir aus verschiedenen Scripten ein Uploadscript zusammengebastelt, welches auch fast so wie ich es hätte funktioniert.
Erweitern möchte ich es nun mit einer Verzeichnisvorwahl. D.h. ich habe ein Dropdownmenü und je nachdem was ich dort vorwähle soll in ein anderes Verzeichnis geladen werden.
Meine Html sieht wie folgt aus:
<html>
<head>
<title>
TSB - 01FS-B
</title>
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>
</head>
<body bgcolor=FFFFFF>
<h1>vionlink Uploads</h1>
<form method="post" action="vionlink_upload.php" enctype="multipart/form-data">
<table cellpadding="4" cellspacing="4" style="border:1px solid;font-family:verdana,sans-serif;">
<tr><td>Datei auswählen</td><td><input type="file" name="uploadfile"> </td></tr>
<tr><td colspan="2" align="center"><br><input type="submit" value="Datei hochladen"><br><br></td></tr></table>
<FORM
ACTION="../cgi-bin/redirect.pl"
METHOD=POST onSubmit="return dropdown(this.gourl)">
<SELECT NAME="gourl">
<OPTION VALUE="/mnt/home/www/tsb/uploads" >Startverzeichnis
<OPTION VALUE="/mnt/home/www/tsb/uploads/Louis/" >Louis
</SELECT>
<INPUT TYPE=SUBMIT VALUE="Go">
</FORM
<br>
';
echo '<a href="'.$_SERVER["PHP_SELF"].'">'.img(2).'</a> ';
echo '<a href="'.$_SERVER["PHP_SELF"].'">Zurück zum Startverzeichnis</a>'.br();
if (empty($topdir)) $topdir = "./";
if ($debug) { f(1); echo "listdir($dir,$topdir,$otherlocation);".br().br(); endf(); }
f(2); listdir($dir,$topdir,$otherlocation); endf();
echo '<br><br><font size="1" face="Verdana"> easydirlist v'.$ver.' <br></font>
</body>
</html>
Über die Datei "vionlink_upload.php" wird da hochgeladen.
In dieser ist auch das Uploadverzeichnis gesetzt welches dann Variabel sein müsste.
Das sieht so aus:
Kann mir jemand helfen und mir sagen wie ich das was ich in meinem Drowdownmenü auswähle in den Uploadpfad bekomme?
Vielen Dank
coke