DanieleCalisti

Object of class stdClass could not be converted to string

Feb 28th, 2022 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2.     ini_set('display_errors', 1);
  3.    
  4.     include '../includes/config.php';
  5.  
  6.     $movie = urlencode($_POST['movie']);
  7.  
  8.     if($_POST['scelta'] == 'tv' || $_POST['scelta'] == 'movie')
  9.     {
  10.         for($i = 0; $i < 3; $i++)
  11.         {
  12.           $url = "https://api.themoviedb.org/3/search/".$_POST['scelta'].
  13.           "?query=".$movie.
  14.           "&api_key=<<mykey>>&page=".($i+1);
  15.  
  16.           echo $url ."<br>";
  17.  
  18.           $output = $class->callApi($url);
  19.  
  20.           foreach ($output->results as $movie)
  21.           {
  22.             $class->createItemCard($movie, $_POST['scelta']);
  23.           }
  24.         }
  25.     }
  26. ?>
Add Comment
Please, Sign In to add comment