i cant find the problem


#1

hello guys
i cant find the problem on that code.
there’s a form called edit.php that inclludes the form inputs and file input
and i want to if i dont want to add picture (from file input) php only update the other variables if i add pic, php update all

update.php;

if ($POST[‘userfile’] != “none”);
{
$uploadedfile = $FILES[‘userfile’][‘tmp_name’];
$src = imagecreatefromjpeg($uploadedfile);
list($width,$height)=getimagesize($uploadedfile);
$newwidth=75;
$newheight=($height/$width)*75;
$tmp = imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
$resim_id = strtolower(substr(ereg_replace(’: ', '
’, $album),0,20));
$resim_id2 = ereg_replace(’ ', '
’, $resim_id);
$tarih = date(“His”);
$image = $resim_id2.".jpg";
imagejpeg($tmp,“images/$image”,75);
imagedestroy($src);
imagedestroy($tmp);
$strSQL = "UPDATE album_arsiv SET artist=’$artist’, album=’$album’, genre=’$genre’, image=’$image’ ";
$strSQL .= “WHERE id=$id”;
$sonuc = mysql_db_query($cfgdbisim,$strSQL);
header (“Location: krmd_goster.php?baslangic=$baslangic”);
}
else
{
$strSQL = “UPDATE album_arsiv SET artist=’$artist’, album=’$album’, genre=’$genre’”;
$strSQL .= “WHERE id=$id”;
$sonuc = mysql_db_query($cfgdbisim,$strSQL);
header (“Location: krmd_goster.php?baslangic=$baslangic”);

}

when i run update.php
Parse error: parse error in C:***update.php on line 30

  1. line is “else”
    but before it gave me no erros but also its tried to add pic. (but i didint add a pic)

sorry for my english i hope you can understand
thx


#2

The error is accurate. No ‘else’ is expected there as you have a semi-colon after your if statement.

if ($_POST['userfile'] != "none"); {


#3

how can i make this script like what i told above
i cant solve im stuck! :-?

if theres nothing in $userfile just update other variables
if theres update all