Hi, in the following code, why they use swithch to identify
image type? cause "move_uploaded_file: do not support
gif or other format? then what fuction I should use to fit all fomat of images(.gif, .bmp,.jpeg). THanks.
Also , what is basement function do?
$type = basename($HTTP_POST_FILES['picture']['type']);
switch ($type) {
case 'jpeg':
case 'pjpeg': $filename = "pictures/$story.jpg";
move_uploaded_file($HTTP_POST_FILES['picture']['tmp_name'],
$filename);
$sql = "update stories
set picture = '$filename'
where id = $story";
$result = mysql_query($sql, $conn);
break;
default: print 'Invalid picture format: '.
$HTTP_POST_FILES['picture']['type'];