Advertisement
Bagosep

Delete Playlist

Jun 2nd, 2021
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement