i have this code. My goal is uploading an image into mysql by using php. This gives error:404. I've checked my code again and again but nothing looks wrong. There are anything wrong with the mysqli_connection, i've tried uploading something else and that worked fine, but for image i have a problem, error:404. Anyone has any ideas about what's the problem here? Note: the current file's name is upload.php
<html>
<head>
<meta charset="UTF-8">
<title>Resim Yükleyiniz</title> //Upload and image
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="resim" value="Resim Seçiniz"> <input type="submit" value="Yükle"> //choose an image , upload
</form>
</body>
<?php
//getting mysqli connection
$con = mysqli_connect("mysql.hostinger.web.tr","*******-user","*****-password") or die(mysql_error());
mysqli_select_db($con,"********-database name") or die(mysql_error());
$ders = $_GET['ders'];
//getting file content
$dosya = $_FILES['resim']['tmp_name'];
if(isset($dosya)){
$resim = addslashes(file_get_contents($_FILES['resim']['tmp_name']));
//control of if the file is an image or not
$resim_boyutu = getimagesize($_FILES['resim']['tmp_name']); //This gives false if the $dosya is not an image
if($resim_boyutu == false)
echo "Lütfen resim türünden bir dosya seçiniz.";
else {
if(!mysqli_query($con,"INSERT INTO $ders VALUES ('','$resim')")) //uploading image into the table
echo "Görüntü yüklenirken bir hata oluştu.";
else
echo "Görüntü yüklendi";
}
}
else
echo "Lütfen resim seçiniz.";
?>
</html>