<?php
@session_start();
include('../inc/conn.php');
include('trade.fun.php');
$userid=$_GET['userid'];
$proid=$_GET['proid'];
$pic=$_GET['pic'];
$sql="select picture from trade_product where userId=$userid and proId=$proid limit 0,1";
$result=mysql_query($sql);
$picture=mysql_result($result,0,'picture');
mysql_free_result($result);
$picurl=ereg_replace($pic.";",'',$picture);
$sql="update trade_product set picture='$picurl' where userId=$userid and proId=$proid";
mysql_query($sql);
$file="picture/$userid/".$pic;
if(unlink($file)){
echo $pic;
}else{
echo "0";
}
?>