Stimmt den der Wert in der $_POST['cat'] Variable????
lg
Flow
hi folks,
hier mein problem:
ich schreibe ein Backend in dem man Fotos auf den Server laden kann,
doch irgendwie werden die immer in das grundverzeichniss in dem die index.php liegt kopiert also in diesem falle galerie...
hier der code:
PHP-Code:<?
if (isset ($_POST['submit']) ) {
$pfad = "/home/www/web9/html/klasse/galerie/".$_POST['cat']."/";
copy ($file, $pfad.$file_name);
echo "Die datei:".$file_name."wurde erfolgreich in /galerie/".$_POST['cat']." kopiert!";
}
else {
?>
<form action="<? echo $PHP_SELF ?>" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
<table align="center" cellpadding="0" border="0">
<tr>
<td><strong>Foto oder Film Upload:</strong></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>Kategorie:</td>
<td>
<select name="cat" type="list">
<option value="sonstiges">Sonstiges</option>
<option value="7fahrt">7.Klassfahrt</option>
<option value="8fahrt">8.Klassfahrt</option>
<option value="proben">Proben</option>
<option value="8klass">8.Klassvorstellungen</option>
<option value="filme">Film Archiv</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td colspan="2">Datei Auswählen:</td>
</tr>
<tr>
<td colspan="2"><input type="file" name="file"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Datei senden..." name="submit"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?
}
?>
hoffe auf eure hilfe.
Pauel
Stimmt den der Wert in der $_POST['cat'] Variable????
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
ja, das sollte das hier sein, also ich will das man die kategorien auswählen kann:
<select name="cat" type="list">
<option value="sonstiges">Sonstiges</option>
<option value="7fahrt">7.Klassfahrt</option>
<option value="8fahrt">8.Klassfahrt</option>
<option value="proben">Proben</option>
<option value="8klass">8.Klassvorstellungen</option>
<option value="filme">Film Archiv</option>
</select>
lg
Also bei mir funktioniert es!!!
Habs auf meinem lokalen Apache ausprobiert und hatte kein Problem!
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
Hab's auch gerade mal nachvollzogen, bei mir geht es ebenfalls
einwandfrei!![]()
arg, scheisse wieso bei mir nicht ?![]()
irgendwie will mir das das zeug dann nicht in der right ordner stecken ...
Solche Probleme kenn ich (leider)!
Schau mal ob der Pfad auch der wirklich richtige ist!
Check mal die php.ini und httpd.conf ob alle Einstellungen so sind wie Sie sein sollen, usw. !!
Oft liegt dort irgendwo der Hund begraben!
Das ist das einzige was ich Dir noch raten kann.
Am Script sollte es nicht liegen da es ja von zwei externen Quellen erfolgreich getestet wurde!
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
Also ich habs jetzt auf Windows und auf Unix getestet und es funktioniert!
Die Zugriffsrechte für die Ordner könntest Du auch noch checken!
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
hm, okay, warte mal. an die httpd.conf und php.ini komm i net ran!
Also, dann mal sehen was sich da machen lässt. werde euch auf dem laufenden halten![]()
schau dir mal die funktion
move_uploaded_file()
an. könnte die bessere Wahl für dich sein.
Beschreibung & Anwendungsbeispiel findest unter php.net
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)