Z formulara html potrebujem uploadnut subor (obrazok) na server, chcem aby sa ulozil do urciteho folderu a do databazy sa zapisalo meno uploadnuteho suboru. Mam jeden skript, ale nefunguje :
Kód: Vybrať všetko
if (is_uploaded_file ($_FILES['image']['tmp_name'])) {
if (move_uploaded_file($_FILES['image']['tmp_name'], "uploads/{$_FILES['image']['name']}")) { // Move the file over.
echo '<p>The file has been uploaded!</p>';
} else { // Couldn't move the file over.
echo '<p><font color="red">The file could not be moved.</font></p>';
$i = '';
}
$i = $_FILES['image']['name'];
} else {
$i = '';
}