Advertisement
Bagosep

Update Playlist

Jun 2nd, 2021
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. require '../vendor/autoload.php';
  2. use GuzzleHttp\Client;
  3.  
  4. $token = $_SESSION['token'];
  5.  
  6. $client = new Client([
  7.     'base_uri' => 'https://api.deezer.com',
  8. ]);
  9.  
  10. if($_POST["title"])
  11. {
  12.     $response = $client->request('POST', 'playlist/'.$_POST['id'].'?access_token='.$token.'&title='.$_POST['title']);
  13.     $playlist = json_decode($response->getBody());
  14.  
  15.     if(!empty($playlist)){
  16.         session_start();
  17.         $_SESSION['msg-success'] = "Data playlist berhasil diubah!";
  18.         header("location: index.php");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement