Hello PHP developer
i do some modification on my index.php page and i do some mistakes because i’am not pro on php ! ! !
[php]<?php
/*
Version: 1.2
Created By: Mahdi
Copyright © 2011 Mahdi
Email: [email protected]
Created: 06/2/2011
*/
require_once ‘header.php’;
echo ‘
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 ‘’;
while( $row = mysql_fetch_array($res) ) {
echo ‘’.$row[catTitle];
}
echo ‘’;
echo ’ ';
echo ‘’;
echo ‘’;
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’;
?>
Select Your Friends
<fb:friend-selector />
<?php } else { echo '
Sorry! No Gifts Found!
'; echo '[/php]
it show :
Parse error: syntax error, unexpected $end in /hermes/bosweb/web208/b2083/server/fb/index.php on line 187
it’s problem about some tag i forgot , please tell me where is the problem on the page !