$BASEURL = $protocol . '://' . $host . ($port == $protocol_port ? '' : ':' . $port) . $request;
$op = $_GET["op"];
if($op == "login") {
$callback_url = $BASEURL . '?op=login-callback';
$auth_url = $rdio->begin_authentication($callback_url);
header("Location: ".$auth_url);
} else if($op == "login-callback") {
$rdio->complete_authentication($_GET["oauth_verifier"]);
header("Location: ".$BASEURL);
} else if($op == "logout") {
$rdio->logOut();
header("Location: ".$BASEURL);
} else {
if ($rdio->loggedIn()) {
$person = $rdio->currentUser()->result;
// make the API call
$results = $rdio->search(
array(
"query" => $person->firstName,
"types" => "Track",
"never_or" => "true"))->result->results;
?><p>
hi there, <?php
echo $person->firstName;
?>
, here are some songs for you:<br>
<? for($i=0; $i<count($results); $i++) {?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"