the page below returns just the search box everytime. ive not attempted to
code the text search yet, but i want it to beable to filter out the
category's, but its just not showing any. any idea's any1? TIA
<body bgcolor="#8C999 B">
<?php
$for = $_GET['for'];
$catagory = $_GET['catagory'];
?>
<div align=center>
<form action="<?php $PHP_SELF ?>" method="GET"> <br><table
bgcolor="#FFF8D 7" cellpadding=6>
<tr> <td> </td> </tr> <tr> <td> <div align=center> Search For:
</div></td> <td> <div align=center> Catagory: </div></td> </td>
</tr> <tr> <td>
<INPUT name=for value=<?php echo ("$for"); ?>>
</td> <td>
<SELECT NAME=catagory SIZE=1>
<OPTION SELECTED>Search All Catagories <OPTION>Flora l
Creations
<OPTION>Decorat ive Lighting
<OPTION>Kitchen ware & Crockery
<OPTION>Fancy Goods & Furniture
</SELECT>
</td> <td>
<INPUT TYPE=submit VALUE="Search">
</td>
</form>
<tr> <td> </td> </tr>
</table>
</div>
<?php if (empty($_GET['catagory'])) { exit; }
$search_catagor y = $_GET['catagory']; $search_for = $_GET['for'];
$dbcnx = @mysql_connect( "a", "b", "c"); $select =
@mysql_select_d b("houseproudla ncs_co_uk1");
switch ($search_catago ry) {
case "Search All Catagories":
$filter_catagor y = "*" ;
break;
case "Floral Creations":
$filter_catagor y = "floral";
break;
case "Decorative Lighting":
$filter_catagor y = "lighting";
break;
case "Kitchenwar e & Crockery":
$filter_catagor y = "kitchenwar e";
break;
case "Fancy Goods & Furniture":
$filter_catagor y = "furniture" ;
break;
default:
echo ("<P> Filter Catagory Didn't Match Anything </P>"); echo
("$search_catag ory");
echo ("$filter_catag ory");
break;
}
$command = "SELECT * FROM stock WHERE 1 AND 'catagory' =
\"$filter_catag ory\" ORDER BY `id`"; $qresult = mysql_query($co mmand)
or die(mysql_error ()); echo ("<center><tabl e width=80%
cellpadding=5>" ); $tablebgcolor = "#FFF8D7";
while ($row = mysql_fetch_arr ay($qresult)) {
if ($tablebgcolor == "#FFF8D7"){ //yellow
$tablebgcolor = "#C5C8FF"; //blue
} else {
$tablebgcolor = "#FFF8D7";
} ?>
<tr ><td> <table border=0 cellspacing=3 width=100% bgcolor=<?php
echo ("$tablebgcolor "); ?>> <tr><td> <table> <tr>
<td><pre>Name : </pre></td> <td><b><?php echo ($row
["name"]); ?></b> </td></tr><tr> <td><pre>Descri ption:
</pre></td> <td><?php echo ($row ["descriptio n"]); ?>
</td></tr><tr> <td><pre>Catago ry: </pre></td> <td><?php echo
($row ["catagory"]); ?> </td></tr><tr> <td><pre>Pric e:
£</pre></td> <td><?php echo ($row ["price"]); ?>
</td></tr><tr> <td><pre>P&P: £</pre></td> <td><?php echo
($row ["pandp"]); ?> </td></tr><tr>
<?php $quantity = $row ["quantity"];
if ($quantity != "0") { ?>
<td><pre>Quanti ty: </pre></td> <td><?php echo ($row
["quantity"]); ?> </td></tr><tr><?php } ?>
<td><pre>Produc t ID: </pre></td> <td> <?php echo ($row
["id"]); ?> </td></tr><tr><td>
<?php if ($quantity == "0") { ?>
<td><b> <font color=#DD0000> Temporarily Out Of Stock
</b></font></tr><tr>
<?php } ?>
</td></tr></table>
</td><td width=30%>
<?php $pictureid = $row ["id"]; ?>
<?php $picturepath = "./images/" . $pictureid . ".jpg"; ?>
<?php
if (file_exists($p icturepath)) {
echo ("<div align=\"center\ "><a href=\"$picture path\"
target=LargeIma ge><img src=$picturepat h height=200 alt='Image
Of Product'></a><font size=2><br>Clic k The Image To See It Full
Size In A New Window</font></div>");
} else {
echo ("<div align=\"center\ "><img src=\"/images/nopic.png\"
height=200 alt='No Picture Available'></a><font
size=2><br>Sorr y, There Is No Picture Available For This
Item</font></div>");
}
?>
</td></tr></table></td></tr>
<?php } ?>
</table></center>
code the text search yet, but i want it to beable to filter out the
category's, but its just not showing any. any idea's any1? TIA
<body bgcolor="#8C999 B">
<?php
$for = $_GET['for'];
$catagory = $_GET['catagory'];
?>
<div align=center>
<form action="<?php $PHP_SELF ?>" method="GET"> <br><table
bgcolor="#FFF8D 7" cellpadding=6>
<tr> <td> </td> </tr> <tr> <td> <div align=center> Search For:
</div></td> <td> <div align=center> Catagory: </div></td> </td>
</tr> <tr> <td>
<INPUT name=for value=<?php echo ("$for"); ?>>
</td> <td>
<SELECT NAME=catagory SIZE=1>
<OPTION SELECTED>Search All Catagories <OPTION>Flora l
Creations
<OPTION>Decorat ive Lighting
<OPTION>Kitchen ware & Crockery
<OPTION>Fancy Goods & Furniture
</SELECT>
</td> <td>
<INPUT TYPE=submit VALUE="Search">
</td>
</form>
<tr> <td> </td> </tr>
</table>
</div>
<?php if (empty($_GET['catagory'])) { exit; }
$search_catagor y = $_GET['catagory']; $search_for = $_GET['for'];
$dbcnx = @mysql_connect( "a", "b", "c"); $select =
@mysql_select_d b("houseproudla ncs_co_uk1");
switch ($search_catago ry) {
case "Search All Catagories":
$filter_catagor y = "*" ;
break;
case "Floral Creations":
$filter_catagor y = "floral";
break;
case "Decorative Lighting":
$filter_catagor y = "lighting";
break;
case "Kitchenwar e & Crockery":
$filter_catagor y = "kitchenwar e";
break;
case "Fancy Goods & Furniture":
$filter_catagor y = "furniture" ;
break;
default:
echo ("<P> Filter Catagory Didn't Match Anything </P>"); echo
("$search_catag ory");
echo ("$filter_catag ory");
break;
}
$command = "SELECT * FROM stock WHERE 1 AND 'catagory' =
\"$filter_catag ory\" ORDER BY `id`"; $qresult = mysql_query($co mmand)
or die(mysql_error ()); echo ("<center><tabl e width=80%
cellpadding=5>" ); $tablebgcolor = "#FFF8D7";
while ($row = mysql_fetch_arr ay($qresult)) {
if ($tablebgcolor == "#FFF8D7"){ //yellow
$tablebgcolor = "#C5C8FF"; //blue
} else {
$tablebgcolor = "#FFF8D7";
} ?>
<tr ><td> <table border=0 cellspacing=3 width=100% bgcolor=<?php
echo ("$tablebgcolor "); ?>> <tr><td> <table> <tr>
<td><pre>Name : </pre></td> <td><b><?php echo ($row
["name"]); ?></b> </td></tr><tr> <td><pre>Descri ption:
</pre></td> <td><?php echo ($row ["descriptio n"]); ?>
</td></tr><tr> <td><pre>Catago ry: </pre></td> <td><?php echo
($row ["catagory"]); ?> </td></tr><tr> <td><pre>Pric e:
£</pre></td> <td><?php echo ($row ["price"]); ?>
</td></tr><tr> <td><pre>P&P: £</pre></td> <td><?php echo
($row ["pandp"]); ?> </td></tr><tr>
<?php $quantity = $row ["quantity"];
if ($quantity != "0") { ?>
<td><pre>Quanti ty: </pre></td> <td><?php echo ($row
["quantity"]); ?> </td></tr><tr><?php } ?>
<td><pre>Produc t ID: </pre></td> <td> <?php echo ($row
["id"]); ?> </td></tr><tr><td>
<?php if ($quantity == "0") { ?>
<td><b> <font color=#DD0000> Temporarily Out Of Stock
</b></font></tr><tr>
<?php } ?>
</td></tr></table>
</td><td width=30%>
<?php $pictureid = $row ["id"]; ?>
<?php $picturepath = "./images/" . $pictureid . ".jpg"; ?>
<?php
if (file_exists($p icturepath)) {
echo ("<div align=\"center\ "><a href=\"$picture path\"
target=LargeIma ge><img src=$picturepat h height=200 alt='Image
Of Product'></a><font size=2><br>Clic k The Image To See It Full
Size In A New Window</font></div>");
} else {
echo ("<div align=\"center\ "><img src=\"/images/nopic.png\"
height=200 alt='No Picture Available'></a><font
size=2><br>Sorr y, There Is No Picture Available For This
Item</font></div>");
}
?>
</td></tr></table></td></tr>
<?php } ?>
</table></center>
Comment