Jump to content

pagination problem


pottidmeat

Recommended Posts

Hi,

I hope someone can help me resolve this issue, as it's driving me crazy.

Here are the respective links just in case it might help to get a clearer picture:

http://www.gmparchitects-la.com/docs/projects.php?project=Water%20Terrace

http://www.atomiccherry.com/clients/gmp/docs/projects.php?project=Water%20Terrace

Here's the skinny...

The "project.php" page on each respective server is identical, line for line.  The problem is that the pagination aspect on the test server (www.atomiccherry.com/) works great, but on the clients server, the one it needs to work on, doesn't function properly.

Here's a snippet of the code:

<?php

if ($totalRows > 1) {
do {
echo "<div class='center'><img src='../images/projects/" . $row['image'] . "' /></div>";
} while ($row = mysql_fetch_array($result));

echo "<div style='text-align: right; font-size: 10px; margin-top: 15px; height: 25px; padding-top: 4px;'>";
if ($page != 1) {
$pageprev = $page - 1;
echo "<a href='projects.php?page=$pageprev&project=" . $_GET['project'] . "'>&lt;&lt; </a>";
} else {

}

$numofpages = $totalRows / $limit;

for ($i = 1; $i <= $numofpages; $i++) {
if ($i == $page && $totalRows > 1) {
echo "<span style='color: #DDDCDB;'> " . $i . " </span>";
} elseif ($totalRows > 1) {
echo "<a href='projects.php?page=$i&project=". $_GET['project'] . "'>$i</a> ";
}
}

if (($totalRows % $limit) != 0) {
if ($i == $page && $totalRows > 1) {
echo "<span style='color: #DDDCDB;'> " . $i . " </span>";
} elseif ($totalRows > 1) {
echo "<a href='projects.php?page=$i&project=" . $_GET['project'] . "'>$i</a> ";

}
}

if (($totalRows - ($limit * $page)) > 0) {
$pagenext = $page + 1;
echo "<a href='projects.php?page=$pagenext&project=" . $_GET['project'] . "'>&gt;&gt;</a>";
} else {
}
echo "</div>";

} // end recordset finds results query

if ($totolRows == 1) {
echo "<div><img src='../images/projects/" . $row['image'] . "' /></div>";
}

?>  
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.