Prøv at se her:
www.storkie.1go.dk/upload.php
Jeg tror i har misforstået!
Når man uploader filen til serveren skal stien til filen skrives ind i mysql
database. I dette tilfælde vil det være upload/filenavn som jeg gerne vil
have sat ind i en database! Er der nogen som kan hjælpe med det? I får lige
scriptet igen:
form enctype="multipart/form-data" action="upload.php" 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
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
$_FILES.
// In PHP earlier then 4.0.3, use copy() and is_uploaded_file() instead of
move_uploaded_file
$uploaddir = '/upload';
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .
$_FILES['userfile']['name'])) {
print "File is valid, and was successfully uploaded.\n";
} else {
print "Possible file upload attack!\n";
}
?>