I have a page where some images are shown (database driven). Here is the code of my gallery.php :
After some hours I found a solution. It works. Although I would still be happy to find a second solution (according to the code I first posted here). Here is the second solution :
form page :
insert to database page :
0)
{
echo "Error: NO CHOSEN FILE
";
echo"INSERT TO DATABASE FAILED";
}
else
{
move_uploaded_file($_FILES["image"]["tmp_name"],"images/" . $_FILES["image"]["name"]);
echo"SAVED
";
$file="images/".$_FILES["image"]["name"];
$sql="INSERT INTO eikones (auxon, path) VALUES ('','$file')";
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
echo "SAVED TO DATABASE";
}
mysql_close();
?>