0){ header('Location: '.$blogurl.'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_POST['posted-variation-group-id'].'&variation-id='.$_POST['posted-variation-id'].'&url='.$blogurl.'&error=2'); } else { if(!file_exists($target_path)){ if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)){ $filename = $randomnumber.urlencode(basename($_FILES['file']['name'])); mysql_query('UPDATE wp_wpsc_variation_values SET variation_picture="'.$filename.'" WHERE id="'.$_POST['posted-variation-id'].'" AND variation_id="'.$_POST['posted-variation-group-id'].'"'); header('Location: '.$blogurl.'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_POST['posted-variation-group-id'].'&variation-id='.$_POST['posted-variation-id'].'&url='.$blogurl.'&error=1'); } else{ header('Location: '.$blogurl.'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_POST['posted-variation-group-id'].'&variation-id='.$_POST['posted-variation-id'].'&url='.$blogurl.'&error=3'); } } else { header('Location: '.$blogurl.'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_POST['posted-variation-group-id'].'&variation-id='.$_POST['posted-variation-id'].'&url='.$blogurl.'&error=4'); } } } else { header('Location: '.$blogurl.'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_POST['posted-variation-group-id'].'&variation-id='.$_POST['posted-variation-id'].'&url='.$blogurl.'&error=5'); } } if($_GET['delete']=='picture'){ unlink('../../../uploads/wpsc/variation_images/'.urlencode($_GET['filename'])); mysql_query('UPDATE wp_wpsc_variation_values SET variation_picture="" WHERE id="'.$_GET['get-variation-id'].'" AND variation_id='.$_GET['get-variation-group-id'].''); header('Location: '.$_GET['url'].'/wp-content/plugins/wp-e-commerce/wpsc-admin/add-variation-picture.php?variation-group-id='.$_GET['get-variation-id'].'&variation-id='.$_GET['get-variation-group-id'].'&url='.$_GET['url'].'&error=6'); } ?>