Location: PHPKode > projects > Online Last.FM Player > start.php
<?php
session_start();

include_once 'class/load.php';

if ( isset($_SESSION['type']) && ($_SESSION['type'] == 'flash' || $_SESSION['type'] == 'embed') ) {
	$player = $_SESSION['type'];
}
else {
	die('Player type is incorrect');
}

if ( isset($_SESSION['user']) ) {
	$user = $_SESSION['user'];
}
else {
	die('Username not present');
}

if ( isset($_SESSION['pass']) ) {
	$pass = $_SESSION['pass'];
}
else {
	die('Password not present');
}

if ( isset($_SESSION['url']) ) {
	$url = $_SESSION['url'];
}
else {
	die('Radio URL not present');
}


$lcs_lastfm = new lcs_lastFm();
if ( !isset($_SESSION['streaming']) || $_SESSION['streaming'] == 0 ) {
	if ( !$lcs_lastfm->connect($user, $pass) ) {
		session_destroy();
		die('Wrong Login');
	}
	if ( !$lcs_lastfm->changeStation($url) ) {
		session_destroy();
		die('Incorrect station url');
	}
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Online Last.FM Player</title>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
	<script type="text/javascript" src="playa.js"></script>
	<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
	<div id="topBar">
		<span id="headerText">Online Last.FM Player</span><br />
		created by <a href="http://www.last.fm/user/lotrgamemast" target="_blank">lotrgamemast</a>
	</div>
	<div id="middleBar">
		<iframe src="meta.php" name="meta" width="100%" height="170" frameborder="0"></iframe>
	</div>
	<div id="bottomBar">
		<div id="controls">
			<a href="http://www.last.fm" target="_blank"><img src="images/powered.gif" alt="" /></a>&nbsp;
			<a href="#" onClick="window.open('docs/index.html','Help','width=500,height=500,left=100,top=100,screenX=100,screenY=100')"><img src="images/help.png" alt="" /></a>&nbsp;&nbsp;
			<a href="cmd.php?cmd=love" target="cmd"><img src="images/love.png" alt="" /></a>&nbsp;&nbsp;
			<a href="#" onClick="window.location.reload();"><img src="images/skip.png" alt="" /></a>&nbsp;&nbsp;
		</div>
		<iframe src="station.php" name="station" width="350" height="30" scrolling="no" frameborder="0"></iframe>
	</div>
	
	<div id="hiddenStuff">
		<iframe src="<?php echo $player; ?>_player.php" name="player" frameborder="1"></iframe>
		<iframe src="cmd.php" name="cmd" frameborder="1"></iframe>
	</div>
	
	<div id="topButtons">
		<a href="boom.php">Finished Listening?</a>
	</div>
</body>
</html>
Return current item: Online Last.FM Player