Curly brackets problem or a nested if problem
Posted: Thu Oct 15, 2009 1:25 pm
Curly brackets problem or a nested if problem i am not sure which it is or both.
this is generated code from a program. it works using xampp on windows but when i
run it on an linux server this section of code seems to be a problem that i have not been
able to figure out. any help would be great.
and this shows on the web page
this is generated code from a program. it works using xampp on windows but when i
run it on an linux server this section of code seems to be a problem that i have not been
able to figure out. any help would be great.
Code: Select all
<?php function showpagenav($page, $pagecount)
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<?php if ($page > 1) { ?>
<td><a href="TEIHOST_MERCHANT.php?page=<? echo $page - 1 ?>"><< Prev</a> </td>
<?php } ?>
<?php
global $pagerange;
if ($pagecount > 1) {
if ($pagecount % $pagerange != 0) {
$rangecount = intval($pagecount / $pagerange) + 1;
}
else {
$rangecount = intval($pagecount / $pagerange);
}
for ($i = 1; $i < $rangecount + 1; $i++) {
$startpage = (($i - 1) * $pagerange) + 1;
$count = min($i * $pagerange, $pagecount);
if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) {
for ($j = $startpage; $j < $count + 1; $j++) {
if ($j == $page) {
?>
<td><b><? echo $j ?></b></td>
<?php } else { ?>
<td><a href="TEIHOST_MERCHANT.php?page=<? echo $j ?>"><? echo $j ?></a></td>
<? php} } } else { ?>
<td><a href="TEIHOST_MERCHANT.php?page=<? echo $startpage ?>"><? echo $startpage ."..." .$count ?></a></td>
<?php } } } ?>
<?php if ($page < $pagecount) { ?>
<td> <a href="TEIHOST_MERCHANT.php?page=<? echo $page + 1 ?>">Next >></a> </td>
<?php } ?>
</tr>
</table>
<? } ?>
Code: Select all
1) { ?> 1) { if ($pagecount % $pagerange != 0) { $rangecount = intval($pagecount / $pagerange) + 1; } else { $rangecount = intval($pagecount / $pagerange); } for ($i = 1; $i < $rangecount + 1; $i++) { $startpage = (($i - 1) * $pagerange) + 1; $count = min($i * $pagerange, $pagecount); } if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) { for ($j = $startpage; $j < $count + 1; $j++) { if ($j == $page) { ?>
<< Prev Next >>
0); { ?>
Index Page Prior Record Next Record