How to delete data based on value in session variable

前端 未结 3 460
后悔当初
后悔当初 2021-01-21 12:05

add.php(When user click add photo)

  
3条回答
  •  臣服心动
    2021-01-21 12:13

    You have a problem here

    $_SESSION["auctionImages"][]= $auctionImage;
    

    Variable $auctionImage itself an array so need not to assign as an array again in SESSION variable. Make it as

    $_SESSION["auctionImages"]= $auctionImage;
    

    It works fine for me.

    below is the code I worked.

    '; print_r($_SESSION['auctionImages']); // Printing final session value. It prints without the key image name
    
    
    
    ?>
    

提交回复
热议问题