No difference. still an empty page, eventhough I deleted the spaces. I tried another approach for the styling. That does work, but maybe it messes up the next page?
Here's my current code. I also added in the next step, since I cannot seem to get the link to that step correctly....
PHP Code:
<?php switch($_GET['step']){
case "items":
$column=2;
$sizecat=mysql_real_escape_string($_GET['size']);
echo "<table style='width:100%;'>\n\t\t<tr>";
$itemsQuery=mysql_query("SELECT DISTINCT thumb_sizecat, sizecat, link_size, size, thumb_size, finalsize FROM `Folders` WHERE `sizecat`='{$sizecat}';");
while($item=mysql_fetch_array($itemsQuery)){
$link="?step=color&sizecat=".urlencode($sizecat)."&finalsize=".urlencode($item['finalsize']);
if ($column==2) {echo "<tr>";}
?>
<td width="25%" align="center"><?php echo "<a href='{$link}'><img src='{$item['thumb_size']}' alt='{$item['thumb_size']}' /><br />{$item['size']}<br />{$item['finalsize']}<br /></a>" ?></td>
<?php
$column++; if ($column==6) { echo "</tr>"; $column=2; }
}
echo "</tr><tr><td align='center' colspan='4'><input type=button value='Back' onClick='history.go(-1)'></td></tr></table>\r\n";
break;
case "color":
$column=2;
$finalsize=mysql_real_escape_string($_GET['finalsize']);
echo "<table style='width:100%;'>\n\t\t<tr>";
$colorQuery=mysql_query("SELECT DISTINCT thumb_sizecat, sizecat, link_size, size, thumb_size, finalsize, color, link_color, thumb_color FROM `Folders` WHERE `finalsize`='{$finalsize}';");
while($item=mysql_fetch_array($colorQuery)){
$link="?step=material&finalsize=".urlencode($finalsize)."&finalsize=".urlencode($item['finalsize']);
if ($column==2) {echo "<tr>";}
?>
<td width="25%" align="center"><?php echo "<a href='{$link}'><img src='{$item['thumb_color']}' alt='{$item['thumb_color']}' /><br />{$item['color']}<br /></a>" ?></td>
<?php
$column++; if ($column==6) { echo "</tr>"; $column=2; }
}
echo "</tr><tr><td align='center' colspan='4'><input type=button value='Back' onClick='history.go(-1)'></td></tr></table>\r\n";
break;
default:
$table = "<table style='width:100%;'><tr>\n";
$result = mysql_query("SELECT DISTINCT thumb_sizecat, sizecat, link_size FROM Folders ORDER BY id") or die (mysql_error());
while($row = mysql_fetch_array($result)){
$row['price1'] = round ((($row['price1']+5) *1.85),0);
$base_m=5;
$row['price11'] = $base_m*(ceil(($row['price1'])/$base_m));
$table.="\t\t<td align='center' style='width:25%;'>"
."<a href='?step=items&size=".urlencode($row['sizecat'])."'><img src='{$row['thumb_sizecat']}' alt='{$row['thumb_sizecat']}' />"
."<br />{$row['sizecat']}</a></td>\n";
$colnum++;if($colnum % 4 == 0) $table.="\t</tr>\n\t<tr>\n";
}
$table .= "\t</tr>\n</table>\n";
echo $table;
break;
}
?>
What do you think?
edit: and yeah, it's for generating the correct url
Bookmarks