PHP 語法

我的上傳程式是

move_uploaded_file($_FILES["pic"]["tmp_name"],"good/goods/pics/".$_FILES["pic"]["name"])

這是我的刪除的程式碼 刪除圖片的程式應該要加在哪??

if ((isset($_GET['id'])) && ($_GET['id'] != "")) {

$deleteSQL = sprintf("DELETE FROM goods WHERE id=%s",

GetSQLValueString($_GET['id'], "int"));

mysql_select_db($database_a12, $a12);

$Result1 = mysql_query($deleteSQL, $a12) or die(mysql_error());

$deleteGoTo = "../../select2.php";

1 Answer

Rating
  • 6 years ago
    Favorite Answer

    你應該要分兩個吧,

    ex:

    $sAction=$_POST[''action];

    switch($sAction)

    {

    case"DELETE":

    //刪除的程式碼

    break;

    case"UPLOAD":

    //上傳的程式碼

    break;

    }

Still have questions? Get your answers by asking now.