<?php
include 'includes/config.php';
include 'header.php';
$check = '';
$TOTAL_FILE = 0;
$rowsPerPage=12;

$PATH = '';

if($parentid != 0)
{
$folddetail = $db->query("select * from category where id = ".$parentid, database::GET_ROW);
$seq =  $folddetail['pathc'];//$db->query("select pathc from category where id = ". $parentid, database::GET_FIELD);
$PATH = '» <a href="'.BASE_PATH.'">Home</a> ';
$PATH .= $seq;
}

if($parentid == 0)
{
$update_list = $db->query('select * from `update` where home = 1 order by id desc');
?>
<div class='updates' align="left">
<h2>Latest Updates</h2>
<?php
foreach($update_list as $field => $value)
{
?>
<div align="left"><?=$value['name']?> <?php if($value['link'] != '') { ?><a href="<?=$value['link']?>" class="new2_text">[Click Here]</a><?php } ?></div>
<?php
} ?>
<div>
<a href="<?=BASE_PATH?>updates/update.html" class="new2_text">[More Updates...]</a>
</div>
</div>
<?php
$check = 'now';
}
else
{

$getfilecat =  $folddetail['subcate'];//$db->query('select subcate from category where id = '.$parentid, database::GET_FIELD);

// get category detail

$FOLDER = $folddetail['folder'];
$DES =  $folddetail['des'];
$NAME = $folddetail['name'];
$THUMB = $folddetail['thumb'];
?>
<div class="description">
<center>
<?php include 'j'.$agent_ext?>
</center>

</div>
<?php

if($getfilecat == 0)
{
// check this folder have a file or not
$checkfileor = $folddetail['totalitem'];// $db->query('select totalitem from category where id = '.$parentid, database::GET_FIELD);
if($checkfileor != 0)
{
$TOTAL_FILE = 1;
$sort = $_GET['sort'];

if($sort == 'download')
$getfilelist = 'select * from file where cid = '.$parentid.' order by download desc';
elseif($sort == 'az')
$getfilelist = 'select * from file where cid = '.$parentid.' order by name';
elseif($sort == 'recent')
$getfilelist = 'select * from file where cid = '.$parentid.' order by id desc';
else
$getfilelist = 'select * from file where cid = '.$parentid.' order by kram desc';

$rowsPerPage=8;
$pagingqry = $getfilelist;
$gets='?';

if($sort == '')
$sort = 'category';

$pagelink = BASE_PATH.'category/'.$sort.'/'.$parentid.'/';
//echo $sort;

$htmlpage = '/'.$nname.'.html';
include("includes/paging.php");

$FILE = $db->query($pagingqry.$limit);
?>
<h2>
<?php
if($nname != '')
echo $nname;
else
echo 'Select Categories';
?>
</h2>
<div class="dtype">
<small>
 | 
<a href="<?=BASE_PATH?>category/download/<?=$parentid?>/<?=$PAGE?>/<?=$NAME?>.html" class="dow_2">
sort by Download
</a>
 | 
<a href="<?=BASE_PATH?>category/az/<?=$parentid?>/<?=$PAGE?>/<?=$NAME?>.html" class="dow_2">
A to Z
</a>
 | 
<a href="<?=BASE_PATH?>category/recent/<?=$parentid?>/<?=$PAGE?>/<?=$NAME?>.html" class="dow_2">
Recent Added
</a>
 | 
</small>
</div>

<table cellspacing="0">
<tbody>
<tr>
<td colspan="2">
<?php include 'h'.$agent_ext?>
</td>
</tr>
<?php
$l = 1;
$file_tot = count($FILE);
for($i=0;$i<$file_tot;$i++)
{
if($l==1)
{
$l++;
$class = 'odd';
}
else
{
$l=1;
$class='even';
}

?>
<tr class="<?=$class?>">
<td class="tblimg">
<?php include 'ind_preview.php';
?>
</td>
<td align="left">
<a class="new_link" href="<?=BASE_PATH?>filedownload/<?=$parentid?>/<?=$FILE[$i]['id']?>/<?=$FILE[$i]['name']?>.html"><?=$FILE[$i]['name']?>.<?=$FILE[$i]['ext']?></a>
<?php
if($FILE[$i]['newtag'] == 1)
echo '<img alt="new" src="'.BASE_PATH.'image/new.gif">';
?>
<br />
<span class="text11">[<?=getSize($FILE[$i]['size'])?>]   |   <?=$FILE[$i]['download']?> Downloads</span>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="2">
<?php include 'i'.$agent_ext?>
</td>
</tr>
</tbody>
</table>
<?php
}
}
else
$check = 'now';
}

if($check == 'now' )
{
echo '<!--Sonugoyal48@gmail.com-->';
?>
<center>
<?=$DES?>
</center>
<div id='cateogry' align="left">
<h2>
<?php
if($nname != '')
echo $nname;
else
echo 'Select Categories';
?>
</h2>
<?php
if($LOGO == '')
include 'h'.$agent_ext;

// this will only for home page
// cat

//$gettotcat = 'select count(id) from category';
//$params['TOTCATE'] = $conn->singleval($gettotcat);
//file
//$gettotfile = 'select count(id) from file';
//$params['TOTFILE'] = $conn->singleval($gettotfile);
//mp4
//$gettotmp4 = 'select count(id) from file where ext = "mp4"';
//$params['TOTMP4'] = $conn->singleval($gettotmp4);
//3gp
//$gettot3gp = 'select count(id) from file where ext = "3gp"';
//$params['TOT3GP'] = $conn->singleval($gettot3gp);

$rowsPerPage=12;
$pagingqry = "select * from category where parentid = ".$parentid. ' order by kram desc';

$gets='?';

$pagelink = BASE_PATH.'category/'.$parentid.'/';

$htmlpage = '/'.$_GET['ht'].'.html';
include("includes/paging.php");

$CATEGORY = $db->query($pagingqry.$limit);


?>
<div class='catList' align="left">
<?php
$l = 1;
$totcat = count($CATEGORY);
for($i = 0 ; $i < $totcat ; $i++)
{
if($l==1)
{
$l++;
$class = 'odd';
}
else
{
$l=1;
$class='even';
}

echo '<div class="'.$class.'">';
if($CATEGORY[$i]['thumb'] == '')
{
if($CATEGORY[$i]['totalitem'] != 0)
echo "<img alt='»' src='".BASE_PATH."image/arrow.gif'> ";
else
echo "<img alt='»' src='".BASE_PATH."image/folder.png'> ";
}
else
echo "<img src='".BASE_PATH."folderthumb/".$CATEGORY[$i]['thumb']."' width='".THUMB_W."' height='".THUMB_H."' alt='".$CATEGORY[$i]['name']."' class='border_4'> ";

echo "<a href='".BASE_PATH."category/".$CATEGORY[$i]['id']."/".$CATEGORY[$i]['name'].".html' class='new_link'>";
echo $CATEGORY[$i]['name'];
if($CATEGORY[$i]['totalitem'] != 0)
{
//if($CATEGORY[$i]['subcate'] == 0)
echo '['. $CATEGORY[$i]['totalitem'] . ']';
}
if($CATEGORY[$i]['newitemtag'] == 1)
echo '<img alt="New" src="'.BASE_PATH.'image/new.gif">';
if($CATEGORY[$i]['updateitemtag'] == 1)
echo '<img alt="Updated" src="'.BASE_PATH.'image/updated.gif">';
echo '</a>';
echo '</div>';
}

if($LOGO != '')
{
echo '<div class="advertisement">';
include 'c'.$agent_ext;
echo '</div>';
}
else
include 'i'.$agent_ext;
?>
</div>
</div>
<?
}
?>
<center>
<?=$PAGE_CODE?>
</center>
<?php


if($TOTAL_FILE != 0)
{
echo '<center>';
include 'k'.$agent_ext;
echo '</center>';
}
?>
<div class="path">
<br /><?=$PATH?>
</div>

<?
include 'footer.php';
?>

no one is going to go through 290+ lines of code for you.

Narrow it down

It's a missing closing brace or semi-colon somewhere I reckon, if you go through and check witha good editor you should be able to find it.
Just quickly skimming, I notice 2 errors: line 280 what? = $PAGE_CODE and line 293 what? = $PATH

I notice 2 errors: line 280 what? = $PAGE_CODE and line 293 what? = $PATH

@TonyG, that is a PHP shorthand and it is echoing out the variables value but it only works when short_open_tag is enabled. It is the equivelent of doing this:

<?php echo $PAGE_CODE; ?>

I wouldn't get too used to using them though, I have a suspicion that they may get deprecated in PHP 6.

I agree with Squidge, no one wants to skim through hundreds of lines of someones code looking for a problem. One mention though, I scrolled past all the code without stopping to comment here and I still saw something that I would recommend doing differently; Get into the habbit of not bouncing in and out of PHP continiously. It will save you some headaches down the road by just not doing it. If you have something like a div to put in then just echo the markup within PHP. The only time I would ever bounce out of the PHP for markup is if it was a large chunk of it, not a one liner.

It simply means that you opened a tag or condition and forgot to close it. Just run through your code once again ...

try watching your indentation a bit, it makes errors like this way easier to find.
I copied your code in netbeans, did an auto-indent and i didn't find any unclosed accolades or php tags, so it's probably going wrong in one of your includes.

Wheres the auto indent?

Ive started using netbeans, that would be handy :-)

The key combination is alt-shift-f.
Theres a handy key list under help>keyboard shortcut card

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.