Bagosep

Delete Playlist

Jun 2nd, 2021
636
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $token = $_SESSION['token'];
  2. require '../vendor/autoload.php';
  3. use GuzzleHttp\Client;
  4.  
  5. $client = new Client([
  6.     'base_uri' => 'https://api.deezer.com',
  7. ]);
  8.  
  9. $response = $client->request('DELETE', 'playlist/'.$_GET['id'].'?access_token='.$token);
  10. $playlist = json_decode($response->getBody());
  11.  
  12. if($playlist == TRUE){
  13.     $_SESSION['msg-success'] = "Data playlist berhasil dihapus!";
  14.     header("location: index.php");
  15. }
RAW Paste Data