Beispiel #1
0
                } elseif ($art == "https://sndcdn.com/images/default_avatar_crop.jpg") {
                    //if no song art or user avatar
                    $art = "photoshop/carousel-headphones-black-red.png";
                    Songs::create($songid, $title, $artistid, $art, $user_id);
                } else {
                    $art = explode("large", $art)[0] . "crop.jpg";
                    //gets a higher quality image
                    Songs::create($songid, $title, $artistid, $art, $user_id);
                }
                header('Content-type: application/json');
                print "success from uploadToDB";
                exit;
            } else {
                if ($resource_type == 'update') {
                    print $_REQUEST['artist_id'];
                    $songid = $_REQUEST['id'];
                    $title = $_REQUEST['song_name'];
                    $artistid = $_REQUEST['artist_id'];
                    $artistname = $_REQUEST['artistname'];
                    Songs::update($songid, $title);
                    Artists::update($artistid, $artistname);
                    header('Content-type: application/json');
                    print "successful update";
                    exit;
                }
            }
        }
    }
}
header("HTTP/1.1 400 Bad Request");
print "Did not understand URL last";