I am not using a form for this and I really would prefer not to if possible, if I was coding in asp I could have it work this way so I know there has to be a way it will work with php. Here is all the code I am using maybe it will lend a better idea to what I am looking for.
The first page that lists the choice of background styles to view is as follows (and works perfectly)
<table border='0' width='600'><tr>
<?php
include("db.inc.php");
$x = 1;
$sql = "SELECT * FROM backgroundfields ORDER BY bgField";
$query = mysql_query($sql);
while($db = mysql_fetch_array($query)) {
if ($x == 1){
$x = 2;
echo "<td width='200' align='center' valign='top'>";
echo "<a href='tdbgs.php?bgtid=$db[0]&tbg=$db[1]'><font class='db'>$db[1]</font></a><br />";
}elseif ($x == 16){
$x = 1;
echo "<a href='tdbgs.php?bgtid=$db[0]&tbg=$db[1]'><font class='db'>$db[1]</font></a><br />";
echo "</td>";
}else{
$x = $x + 1;
echo "<a href='tdbgs.php?bgtid=$db[0]&tbg=$db[1]'><font class='db'>$db[1]</font></a><br />";
}
}
?>
</tr></table>
The above code lists on one page all background styles, when you choose a style it then sends the variables re the url in which I grab and then reset them to use within my code on the next page. The next page is suppose to list all of the backgrounds within that background type, using paging to only display 20 per page, it is within the paging code that I have had difficulties getting it to pass the variables again, I have tried adding the code to the various spots (that have <a href...> but no luck as well as a few other spots trying different things and still no luck.
<table border='0' width='600'><tr><td align='center' colspan='5'>
<?php
include("db.inc.php");
include("MySQLPagedResults.class.php");
foreach($_GET as $key => $value)
{
$$key = $value;
}
$ttbg = $tbg;
$ctbg = strtoupper($tbg);
$tbgtid = $bgtid;
echo "<font class='db1'>$ctbg BACKGROUNDS</font><br /><br /></td></tr><tr>";
$paging_results = new MySQLPagedResults("SELECT count(*) FROM BACKGROUNDS WHERE bgField LIKE $bgtid","page","",20,10,"<<","Previous","Next",">>"," | ");
$first_nav = $paging_results->getFirstNav();
$prev_nav = $paging_results->getPrevNav();
$next_nav = $paging_results->getNextNav();
$last_nav = $paging_results->getLastNav();
$pages_nav = $paging_results->getPagesNav();
$offset = $paging_results->currentOffset();
$results_per_page = $paging_results->results_per_page;
$current_page = $paging_results->current_page;
$total_pages = $paging_results->totalPages();
$start_number = $paging_results->getResultNumbersStart();
$end_number = $paging_results->getResultNumbersEnd();
$x = 1;
$sql = "SELECT * FROM BACKGROUNDS WHERE bgField LIKE $bgtid LIMIT $offset,$results_per_page";
$query = mysql_query($sql);
while($db = mysql_fetch_array($query)) {
if ($x == 1){
$x = 2;
echo "<tr>";
echo "<td width='120' align='center' valign='middle'>";
echo "<a href='backgrounds/$db[1]' target='_blank'><img src='backgrounds/.$db[1]' border='0' width='$db[3]' height='$db[4]' /></a><br />";
echo "</td>";
}elseif ($x == 5){
$x = 1;
echo "<td width='120' align='center' valign='middle'>";
echo "<a href='backgrounds/$db[1]' target='_blank'><img src='backgrounds/.$db[1]' border='0' width='$db[3]' height='$db[4]' /></a><br />";
echo "</td></tr>";
}else{
$x = $x + 1;
echo "<td width='120' align='center' valign='middle'>";
echo "<a href='backgrounds/$db[1]' target='_blank'><img src='backgrounds/.$db[1]' border='0' width='$db[3]' height='$db[4]' /></a><br />";
echo "</td>";
}
}
echo "<tr><td colspan='5' align='center'>";
echo "<font class='db1'><p><b>Page:</b> $current_page of $total_pages | <b>Results:</b>
$start_number - $end_number<br /><br />";
echo "$first_nav $prev_nav $pages_nav $next_nav $last_nav</p></font>";
echo "</td></tr>";
?>
</table>
If I hardcode within the query then the paging works fine, but as you can see I cannot do that if I want to only have one page run for this whole function, using the variable within the query works on the front page only, and I have tried various different things to see if I could pass the variables on to the all of the other pages with the prev/next pageset.
Thank you so much
purplevortex