Hi there! making a portfolio page for my website, and the code seems to work. but the links for pagination do not show up
Here are the files I'm working with
Contents of the callid_port.php file
Contents of pagination.php
Contents of pagination2.php
It works, but the PREV and NEXT don't show up as links :s
Any Ideas? (Link To Page
TIA
Here are the files I'm working with
Contents of the callid_port.php file
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Portfolio</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include('config.php');
// request text from all the jokes
include('pagination.php');
echo("<table class='prod' cellpadding='3' border='3'>");
echo("<tr><td colspan='4'><h3 align='center'>Sort Portfolio By: <a href='id.html'>All</a> | <a href='dsnrs.html'>Designer</a> | <a href='live.html'>Live Sites</a></h3></td></tr>
<tr>
<td><h4 align='center'> Design Thumbnail </h4></td><td><h4 align='center'> Design Title </h4></td><td><h4 align='center'> Design Author </h4></td>
<td><h4 align='center'> Design URL </h4></td>
</tr>
");
while ( $row = mysql_fetch_array($result) ) {
$id = $row["ID"];
$dsnr = $row["dsnr"];
$img = $row["img"];
$live = $row["live"];
$port_desc = $row["port_desc"];
$href = $row["href"];
$title = $row["title"];
if (empty($row)) {
echo("<h1>Coming Soon!</h1>"); }
elseif($live==1){
$ahref = "<a href='" . $href . "' target='_blank'>" . $title . "</a> *Live Site!*" ;
}else ( $ahref= "Not Live" );
echo("<tr><td class='td2'>" . "<a href='/images/" . $img . "' target='_blank'><img width='90px' height='120px' src='/images/" . $img . "' title='Click For Larget Image' border='0' /></a>" . "</td><td class='td3'><p align='center'>" . $title . "</p>" . "</td><td class='td4'>" . $dsnr . "</td><td class='td5'>" . $ahref . "</td></tr><tr><td colspan='4'><blockquote> <p align='left'>Design Description:</p>" . $port_desc . "</blockquote></td></tr>");
}
include('pagination2.php');
echo("</table>");
;
?>
</body>
</html>
Contents of pagination.php
Code:
<?
$limit = 5;
$query_count = "SELECT count(*) FROM port";
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
if(empty($page)){
$page = 1;
}
$limitvalue = $page * $limit - ($limit);
$query = "SELECT * FROM port LIMIT $limitvalue, $limit";
$result = mysql_query($query) or die("Error: " . mysql_error());
if(mysql_num_rows($result) == 0){
echo("Nothing to Display!");
}
?>
Contents of pagination2.php
Code:
<?
if($page != 1){
$pageprev = $page--;
echo("<a href=\"callid_port.php&page=$pageprev\">PREV".$limit."</a> ");
}else{
echo("PREV".$limit." ");
}
$numofpages = $totalrows / $limit;
for($i = 1; $i <= $numofpages; $i++){
if($i == $page){
echo($i." ");
}else{
echo("<a href=\"callid_port.php?page=$i\">$i</a> ");
}
}
if(($totalrows % $limit) != 0){
if($i == $page){
echo($i." ");
}else{
echo("<a href=\"callid_port.php?page=$i\">$i</a> ");
}
}
if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page++;
echo("<a href=\"callid_port.php?page=$pagenext\">NEXT".$limit."</a>");
}else{
echo("NEXT".$limit);
}
mysql_free_result($result);
?>
It works, but the PREV and NEXT don't show up as links :s
Any Ideas? (Link To Page
TIA
Last edited:







