$path1='./upload/'.$userid.'/';
if(!$path1.$category_name.'_'.$i.'_product_image1.jpg')
{
$file1 = fopen($path1.$category_name.'_'.$i.'_product_image1.jpg', 'wb');
$file2 = fopen($path1.$category_name.'_'.$i.'_product_image2.jpg', 'wb');
$file3 = fopen($path1.$category_name.'_'.$i.'_product_image3.jpg', 'wb');
fwrite($file1, $binary1);
fwrite($file2, $binary2);
fwrite($file3, $binary3);
$path = $category_name.'_'.$i;
}
else {"already exists";}
$Gimage1 = mysql_real_escape_string(base_url($path1.$path.'_product_image1.jpg'));
$Gimage2 = mysql_real_escape_string(base_url($path1.$path.'_product_image2.jpg'));
$Gimage3 = mysql_real_escape_string(base_url($path1.$path.'_product_image3.jpg'));
fclose($file1);
fclose($file2);
fclose($file3);
why is the if condition not checking whether image in that path already not exists... it simply enters into if condition so please help.