Hallo
Mein Problem sind Speicherort und Zielverzeichnis.
Ich nutze PHP-Handbuch und Online PHP Einsteigerkurs, selfhtml.
PHP-Datei habe ich php.php genannt
- Muss ich action=_URL_ ändern in action=meinehomepage.de/php.php ?
- '/var/www/uploads/' ändern in /www/htdocs/username/php.php ?
- 'tmp_name' selbst erstellen in meinehomepge.de/tmp_name ?
Wo ändere ich den Speicherort grundsätzlich ?
Ich wurde auch schon etwas schlauer durch "phpinfo()"
html Code:
form enctype="multipart/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
PHP-Code:
<?php
// In PHP kleiner als 4.1.0 sollten Sie $HTTP_POST_FILES anstatt $_FILES verwenden.
// In PHP kleiner als 4.0.3 verwenden Sie copy() und is_uploaded_file() anstatt von
// move_uploaded_file()
$uploaddir = '/var/www/uploads/';
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) {
print "File is valid, and was successfully uploaded. Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
?>