I have this function and when I load the page in the browser I keep on receiving an error that the last'}' shouldn't be there and I don't know why because everything seems right to me. Anyone could tell me where could be the problem?

function PageCompTopRated($w,$h)
{
    global $site;
	global $ID_PIC_DIR;
	global $ID_PIC_URL;
	global $vote_pic_max;
	global $index_progressbar_w;

	// most rated profiles

	$rate_max = get_max_votes_profile();

	$thumb_width = getParam("thumb_width");

	$rate_memb_week   = db_arr( "SELECT Headline, NickName, Member, COUNT(*) AS `count`, SUM(Mark)/COUNT(*) AS mark, ID, Pic_0_addon  FROM `Votes` INNER JOIN Profiles ON (ID = Member) WHERE Status = 'Active' AND TO_DAYS(NOW()) - TO_DAYS(`Date`) <= 7 GROUP BY Member HAVING `count` > 0 ORDER BY Mark DESC LIMIT 1" );
	$rate_memb_month  = db_arr( "SELECT Headline, NickName, Member, COUNT(*) AS `count`, SUM(Mark)/COUNT(*) AS mark, ID, Pic_0_addon  FROM `Votes` INNER JOIN Profiles ON (ID = Member) WHERE Status = 'Active' AND TO_DAYS(NOW()) - TO_DAYS(`Date`) <= 30 GROUP BY Member HAVING `count` > 0 ORDER BY Mark DESC LIMIT 1" );

//	$rate_memb_week   = db_arr( "SELECT Headline, NickName, Member, COUNT(*) AS `count`, SUM(Mark)/COUNT(*) AS mark, ID, Pic_0_addon  FROM `Votes` INNER JOIN Profiles ON (ID = Member) WHERE Status = 'Active' AND TO_DAYS(NOW()) - TO_DAYS(`Date`) <= 7 GROUP BY Member ORDER BY Mark DESC,`count` DESC LIMIT 1" );
//	$rate_memb_month  = db_arr( "SELECT Headline, NickName, Member, COUNT(*) AS `count`, SUM(Mark)/COUNT(*) AS mark, ID, Pic_0_addon  FROM `Votes` INNER JOIN Profiles ON (ID = Member) WHERE Status = 'Active' AND TO_DAYS(NOW()) - TO_DAYS(`Date`) <= 30 GROUP BY Member ORDER BY Mark DESC,`count` DESC LIMIT 1" );


	$src = "$ID_PIC_DIR$rate_memb_week[ID]_0_$rate_memb_week[Pic_0_addon].jpg";
	if ( file_exists($src) )
		$rate_memb_week[img] = "$ID_PIC_URL$rate_memb_week[ID]_0_$rate_memb_week[Pic_0_addon].jpg";
	else
		$rate_memb_week[img] = "$site[images]pic_not_avail.gif";

	$src = "$ID_PIC_DIR$rate_memb_month[ID]_0_$rate_memb_month[Pic_0_addon].jpg";
	if ( file_exists($src) )
		$rate_memb_month[img] = "$ID_PIC_URL$rate_memb_month[ID]_0_$rate_memb_month[Pic_0_addon].jpg";
	else
		$rate_memb_month[img] = "$site[images]pic_not_avail.gif";


	ob_start();
?><table width="100%" height="100%" align="center" cellpadding=0 cellspacing=0 border=0 class=text>
	<tr height=17>
	<td align=center width=50%>

	<b><?php echo _t("_Profile of the week"); ?></b></td>
	<td rowspan=3 class=top_rated_0><img src=<? echo $site[images]; ?>spacer.gif width=1 height=1></td>
	<td align=center width=50%><b><?php echo _t("_Profile of the month"); ?></b></td>
	</tr>
	<tr>
	<td height=1 class=top_rated_1><img src=<? echo $site[images]; ?>spacer.gif width=1 height=1></td>
	<td height=1 class=top_rated_2><img src=<? echo $site[images]; ?>spacer.gif width=1 height=1></td>
	</tr>
	<tr>
	<td valign="middle">
		<table width=100% height=100% cellpadding=0 cellspacing=0 class=text border=0>
		<tr>
		 <?
            global $tmpl;
            if ( $tmpl == 'adl' || $tmpl == 'hip')
                {
                echo "<td width=\"100%\" valign=\"middle\" align=\"center\">";
                 }
            else
                {
                echo "<td width=\"50%\" valign=\"bottom\" align=\"center\">";
                }
            ?>
			 <div align="center" STYLE="width: <?php echo $thumb_width; ?>; overflow : hidden">
			 <?php echo ("<a href='$site[url]profile.php?ID=$rate_memb_week[ID]'>"); ?>
			 <img align=center <?php echo $thumb_pic_size; ?> alt="<?php echo "$rate_memb_week[NickName] : $rate_memb_week[Headline]"; ?>" title="<?php echo "$rate_memb_week[NickName] : $rate_memb_week[Headline]"; ?>" border=0 src=<?php echo ($rate_memb_week[img]); ?>></a>
			 </div>
			</td>
		   <?
                global $tmpl;
                if ( $tmpl == 'adl' || $tmpl == 'hip')
                    {
                    echo "</tr><tr><td valign=\"middle\" align=center>";
                    }
                else
                    {
                    echo "<td valign=\"bottom\" align=center>";
                    }
		  ?>
			<?php echo DesignProgressPos ( _t("_score").": ".$rate_memb_week[mark], $index_progressbar_w, $vote_pic_max, $rate_memb_week[mark] ); ?>
			<?php echo DesignProgressPos ( _t("_votes").": ".$rate_memb_week[count], $index_progressbar_w, $rate_max, $rate_memb_week[count] ); ?>
			<img src=<? echo $site[images]; ?>spacer.gif height=2 width=10></td>
		</tr>
		</table>
	</td>

	<td>
	<table width=100% height=100% cellpadding=0 cellspacing=0 class=text border=0>
		<tr>
		 <?
            global $tmpl;
            if ( $tmpl == 'adl' || $tmpl == 'hip' )
                {
                echo "<td width=\"100%\" valign=\"middle\" align=\"center\">";
                 }
            else
                {
                echo "<td width=\"50%\" valign=\"bottom\" align=\"center\">";
                }
            ?>
			<div STYLE="width: <?php echo $thumb_width; ?>; overflow : hidden">
	       <?php echo ("<a href='$site[url]profile.php?ID=$rate_memb_month[ID]'>"); ?>
			<img <?php echo $thumb_pic_size; ?> alt="<?php echo "$rate_memb_month[NickName] : $rate_memb_month[Headline]"; ?>" title="<?php echo "$rate_memb_month[NickName] : $rate_memb_month[Headline]"; ?>" border=0 src=<?php echo ($rate_memb_month[img]); ?>></a>
			</div>
		  </td>
		<?
            global $tmpl;
            if ( $tmpl == 'adl' || $tmpl == 'hip')
                {
                echo "</tr><tr><td valign=\"middle\" align=\"center\">";
                }
            else
                {
                echo "<td valign=\"bottom\" align=\"center\">";
                }
		 ?>

				<?php echo DesignProgressPos ( _t("_score").": ".$rate_memb_month[mark], $index_progressbar_w, $vote_pic_max, $rate_memb_month[mark] ); ?>
				<?php echo DesignProgressPos ( _t("_votes").": ".$rate_memb_month[count], $index_progressbar_w, $rate_max, $rate_memb_month[count] ); ?>

				<img src=<? echo $site[images]; ?>spacer.gif height=2 width=10></td>
			</tr>
		</table>
	</td>
	</tr>
    </table><?php

	$out = "";
    $out = ob_get_contents();
    ob_end_clean();

    return DesignBoxContent ( _t("_top rated"), $w, $out, $h );
	
}

post the exact error message that you have received.

Parse error: syntax error, unexpected '}' in D:\wamp\www\aDating\index.php on line 715

The error is missing close bracket in somewhere. Maybe, line 715 and above. Check all line 1 to 715, all bracket are closing properly.

Zero13 is correct.If you properly closing all braces then replace all <? with <?php. Because some versions don't support <?.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.