Syntax Error

Parse error: syntax error, unexpected T_EMPTY, expecting '(' i

Page 1 of 1

2 Replies - 3900 Views - Last Post: 25 June 2008 - 05:48 PM Rate Topic: -----

#1 heathman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-June 08

Syntax Error

Post icon  Posted 25 June 2008 - 03:22 PM

<?php
@include 'forum/include/user/header.php'; ?>
	<tr>
		<td colspan="2">
		<?php @include 'forum/include/user/navigation.php'; ?>
		</td>
	</tr>
	<tr>
		<td style="width: 600px; height: 7px" valign="top" class="episodetitle">
Welcome to the News</td>
		<td style="width: 200px" valign="top" rowspan="2"><div id="nextup"><div id="section">Next Episode</div></div><div id="previous"><div id="section">Previous Episode</div></div></td>
	</tr>
	<tr>
		<td style="width: 600px; height: 7px" valign="top">
		<blockquote style="width: 570px"><?php
	$season = $_GET[s];
	$episode = $_GET[ep];
	$movie = $_GET[mov];
@include 'db_config.php';
@include 'db_connect.php';
	if  empty(' . $season . ') && empty(' . $episode . '){
		$sql = mysql_query('SELECT * FROM `videos`');
		$videos = mysql_get_array($sql);
		$title = $videos['title'];
		$season = $videos['season'];
		$episode = $videos['episode'];
	}
	elseif !empty($season) && empty($episode){
		$sql = mysql_query('SELECT * FROM `videos` WHERE season = "$season"');
		while($videos = mysql_fetch_array($sql)){
			$title = $videos['title'];
			$episode = $videos['episode'];
		}
	}
	elseif !empty($season) && !empty($episode){
		$sql = mysql_query('SELECT * FROM `videos` WHERE season = "$season" AND episode = "$episode"');
		$video = mysql_get_array($sql);
		$title = $video['title'];
		$mirrors = $video['mirrors'];
		$mirrors = explode($mirrors, ";");
		$mirrors = shuffle(shuffle($mirrors));
		$mirror = $mirrors[1];
		echo("
			<script type=\"text/javascript\">
		
		 * window.onload event occurs after all HTML elements have been loaded
		 * this is a good place to setup your Flash elements
		 */
		window.onload = function() {  
			
			 /*
				use flashembed to place flowplayer into HTML element 
				whose id is \"example\" (below this script tag)
			 */
			 flashembed(\"episode\", 
			
				/* 
					first argument supplies standard Flash parameters. See full list:
					http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
				*/
				{
					src:'../swf/FlowPlayerLP.swf',
					width: 600, 
					height: 400
				},
				
				/*
					second argument is Flowplayer specific configuration. See full list:
					http://flowplayer.org/player/configuration.html
				*/
				{config: {   
					autoPlay:false,
					controlBarBackgroundColor:'0x2e8860',
					initialScale: 'scale',
					videoFile: '".$mirror."'
				}} 
			);
		}
		</script>
	");
	}
	else{
		//error
	}
?>

</blockquote>
<?php @include 'forum/include/user/footer.php'; ?>


Is there anyway you guys could help me out? It says parse error in the code on line 21, which is
if  empty(' . $season . ') && empty(' . $episode . '){
Thanks in advance :)

Is This A Good Question/Topic? 0
  • +

Replies To: Syntax Error

#2 Arhineus  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 14-June 08

Re: Syntax Error

Posted 25 June 2008 - 04:25 PM

This may be ignorant, but why are you calling the statement like this?

if  empty(' . $season . ') && empty(' . $episode . ')


Could you not achieve the same with this?

if (empty($season) && empty($episode))

Was This Post Helpful? 0
  • +
  • -

#3 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Syntax Error

Posted 25 June 2008 - 05:48 PM

also, on that line you're missing the if statement's () >_>
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1