Could you tell me plase whats wrong with my code it doesnt work
<?php
$Kaynak=$_FILES["dosya"]["tmp_name"];
$Dsize=$_FILES["dosya"]["size"];
$ad=$_FILES["dosya"]["name"];
$tur=$_FILES["dosya"]["type"];
$hedef="./img";
if($tur == "image/png" || $tur == "image/pjpg")
{
$sonuc=move_uploaded_file($Kaynak,$hedef.'/'.$ad);
if($sonuc)
echo "ok";
}
?>
file upload
Moderator: General Moderators
Re: file upload
Does the folder you're trying to move the file to have 777 permissions?
Otherwise the folder cannot be written too.
Also does the form have enctype="multipart/form-data", that caught me out once.
Otherwise the folder cannot be written too.
Also does the form have enctype="multipart/form-data", that caught me out once.
Re: file upload
if i type just one equal sign it works but should be double right
it works this way
<?php
$Kaynak=$_FILES["dosya"]["tmp_name"];
$Dsize=$_FILES["dosya"]["size"];
$ad=$_FILES["dosya"]["name"];
$tur=$_FILES["dosya"]["type"];
$hedef="./img";
if($tur = "image/png" || $tur = "image/pjpg")
{
$sonuc=move_uploaded_file($Kaynak,$hedef.'/'.$ad);
if($sonuc)
echo "ok";
}
?>digrev
Forum Newbie
Posts: 9
Joined: Sat Jun 19, 2010 2:51 pm
Private messageE-mail digrev
it works this way
<?php
$Kaynak=$_FILES["dosya"]["tmp_name"];
$Dsize=$_FILES["dosya"]["size"];
$ad=$_FILES["dosya"]["name"];
$tur=$_FILES["dosya"]["type"];
$hedef="./img";
if($tur = "image/png" || $tur = "image/pjpg")
{
$sonuc=move_uploaded_file($Kaynak,$hedef.'/'.$ad);
if($sonuc)
echo "ok";
}
?>digrev
Forum Newbie
Posts: 9
Joined: Sat Jun 19, 2010 2:51 pm
Private messageE-mail digrev