Mike: Hiiiiilfe ; unexpected $end

Beitrag lesen

Heyho, ich nutze ein Script für eine Facebook App, jedoch erhalte ich jedesmal den Fehlercode:
Parse error: syntax error, unexpected $end in /home/www/web173/html/gift/index.php on line 163

http://experty.de/gift/

Das ist der code der index.php

<?php  
  
/*  
=====================================================  
 Facebook Gift Store Application  
-----------------------------------------------------  
 Version:    1.2  
-----------------------------------------------------  
 Created By: Shyamal Borsaikia  
=====================================================  
 Copyright © 2011 Shyamal Borsaikia  
=====================================================  
 Email: shyamalborsaikia@gmail.com  
-----------------------------------------------------  
 Created: 5/1/2011  
=====================================================  
*/  
  
require_once 'header.php';  
  
echo '<div class=mainBox>';  
  
if( isset($_POST['sendGift']) ) {  
  
	$giftId = $_POST['giftId'];  
	//$friends = (isset($_REQUEST["ids"]) ? $_REQUEST["ids"] : null);  
	$friends = $_POST[friend_selector_id];  
  
	if( empty($giftId) ) {  
		echo '<div class="noticeBox">';  
		echo '<h2>Your fotgot to select a gift!</h2>';  
		echo '</div>';  
	}  
	else if( empty($friends) ) {  
		echo '<div class="noticeBox">';  
		echo '<h2>Your fotgot to select your friends!</h2>';  
		echo '</div>';  
	}  
	else {  
  
		$player = Player::getById($user);  
		$gift = Gift::getById($giftId);  
  
		$player->point -= $gift->price;  
		$player->save();  
		$gift->hit++;  
		$gift->save();  
		  
		send_gift( $user, $friends, $giftId );  
  
/************************************************/  
/* Publish Stream */  
/************************************************/  
  
$name = $appTitle;  
$name_href = $appCanvasUrl;  
$caption = 'I sent you a '.$gift->title.' using '.$appTitle;  
$description = 'Send beautiful gifts using '.$appTitle;  
$img_1 = $appCallbackUrl.'gifts/'.$gift->image;  
$img_1_href = $appCanvasUrl;  
$action_links_text = 'Send '.$appTitle;  
$action_links_href = $appCanvasUrl;  
	  
$attachment = array(  
			'name' => $name,  
			'href' => $name_href,  
			'caption' => $caption,  
			'description' => $description,  
			'media' => array(  
							array( 	'type' => 'image',  
									'src' => $img_1,  
									'href' => $img_1_href )  
						)  
				);  
		$action_links = array(  
							array( 	'text' => $action_links_text,  
									'href' => $action_links_href)  
						);  
				echo '<select name=type>';  
		while( $row  = mysql_fetch_array($res) ) {  
			echo '<option value='.$row[catid].'>'.$row[catTitle];  
		}  
		echo '</select>';  
		echo ' <input type="submit" name="searchGift" value="View" class="submitButton">';  
		echo '</form>';  
	echo '</td>';  
  
	echo '</tr>';  
	echo '</table>';  
  
if( !empty($_POST[type]) ) $giftType = $_POST[type];  
else if( !empty($_GET[type]) ) $giftType = $_GET[type];  
else {  
	$res = query("SELECT * FROM `gifts_category` LIMIT 0,1");  
	$row  = mysql_fetch_assoc($res);  
	$giftType = $row[catid];  
}  
	  
// Page Navigation  
$res = query("SELECT COUNT(*) FROM `gifts` WHERE `gCat`=$giftType");  
list($total) = mysql_fetch_array($res);  
  
if( $total>0 ) {  
  
	$limit=3;  
	if(!isset($_GET[page]))  
		$page=1;  
	else  
		$page=$_GET[page];  
  
	if($total>0)  
	{  
		$p = new pagination();  
		$p->Items($total);  
		$p->limit($limit);  
  
		if( empty($giftType) ) $p->target('index.php');  
		else $p->target('index.php?type='.$giftType);  
  
		$p->currentPage($_GET['page']);  
		$p->calculate();  
		$p->changeClass("pagination");  
	}  
	$counter = 0;  
	$offset = ($page-1) * $limit;  
  
	echo '<div class=navigation>';  
	$p->show();  
	echo '</div><BR>';  
  
	$res = query("SELECT * FROM `gifts` WHERE `gCat`=$giftType ORDER BY `gid` ASC LIMIT $offset,$limit");  
  
	echo '<form action="'.$appCanvasUrl.'" method="POST">';  
  
	echo '<table width=100% border=0 class="giftTable">';  
	echo '<tr>';  
  
	while( $row = mysql_fetch_array($res) ) {  
		echo '<td>';  
		echo '<CENTER><img src='.$appCallbackUrl.'gifts/'.$row[gImage].' width=240 height=320></CENTER>';  
		if( $player->point > $row[gPrice] ) {  
			echo '<P class=titleP><input type=radio name=giftId value='.$row[gid].'>'.$row[gTitle].'</P>';  
		}  
		else {  
			echo '<P class=titleP><input type=radio name=giftId value='.$row[gid].' disabled=true>'.$row[gTitle].'</P>';  
		}  
		echo '<P>Price: $'.$row[gPrice].' <BR> Sent '.$row[ghit].' Times</P>';  
  
		echo '</td>';  
  
		$counter++;  
		if( $counter == 4 ) {  
			echo '</tr><tr>';  
			$counter = 0;  
		}  
	}  
  
	echo '</tr></table>';  
        echo '</div>';  
  
include 'ads/skyscrapper.php';  
?>

Kann mir vielleicht wer helfen? :(
bin überfragt...

lg