Hello i'm using the following code
move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img");
$instr = fopen("latest.img","rb");
$image = addslashes(fread($instr,filesize("latest.img")));
i would like $image to equal "" or 0 if $imagefile is not passed
something like:
if(empty($_FILES['imagefile'])) {
$image = '';
} else {
move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img");
$instr = fopen("latest.img","rb");
$image = addslashes(fread($instr,filesize("latest.img")));
}
the above is not working
please help