artosousa Posted February 6, 2009 Share Posted February 6, 2009 So i am working on a website for a client... and i want it so when they click on a specific category it only calls out the category in the table... THIS IS HOW IT IS DISPLAYED NOW, everything in the table listed. http://tandtjewellers.ca/collections.php and i want to be able to use this page http://tandtjewellers.ca/collelctions.php and when they click on a category it goes to a list and just calls out the specific category... right now in the long list i have the drop down menu where you can only select a category i was wondering if its along those lines?..... Quote Link to comment https://forums.phpfreaks.com/topic/144106-need-help-asap/ Share on other sites More sharing options...
Maq Posted February 6, 2009 Share Posted February 6, 2009 collelctions.php: (need to link these to the images) Anniversary Trinity //etc... collections.php: $cat = $_GET['category']; SELECT * FROM table WHERE category = '$cat'; //display all your jewelry Quote Link to comment https://forums.phpfreaks.com/topic/144106-need-help-asap/#findComment-756146 Share on other sites More sharing options...
artosousa Posted February 6, 2009 Author Share Posted February 6, 2009 alright so i linked the one image anniversary but it just goes to the collection page which still lists all of the items Quote Link to comment https://forums.phpfreaks.com/topic/144106-need-help-asap/#findComment-756154 Share on other sites More sharing options...
aebstract Posted February 6, 2009 Share Posted February 6, 2009 Can we see your collections.php code? Quote Link to comment https://forums.phpfreaks.com/topic/144106-need-help-asap/#findComment-756155 Share on other sites More sharing options...
artosousa Posted February 6, 2009 Author Share Posted February 6, 2009 oh wait its a different page that the action is linked to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>T&T JEWELLERS - Manufacturers of Fine Jewellery</title> <link href="untitled.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="title"><img src="images/image_01.png" width="840" height="146" /> <div id="login"> <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="291" border="0" bgcolor="#999999"> <tr> <td width="124" align="right">Username:</td> <td width="151"><label> <input type="text" name="textfield" id="textfield" /> </label></td> </tr> <tr> <td align="right">Password:</td> <td><label> <input type="password" name="textfield2" id="textfield2" /> </label></td> </tr> <tr> <td align="right"> </td> <td><label> <input type="submit" name="button" id="button" value="Submit" /> </label></td> </tr> </table> </form> </div> </div> <div id="nav"><a href="index.php"><img src="images/image_02.png" width="189" height="51" border="0" /></a><a href="aboutus.php"><img src="images/image_03.png" width="152" height="51" border="0" /></a><a href="collections.php"><img src="images/image_04.png" width="154" height="51" border="0" /></a><img src="images/image_05.png" width="152" height="51" /><a href="contact.php"><img src="images/image_06.png" alt="" width="193" height="51" border="0" /></a><br /> </div> <div id="contentbg"> <div id="category"> <form id="form3" name="catagoryform" method="get" action="itemslisttest.php"> <label> <select name="thiscatagory" id="thiscatagory" onchange="catagoryform.submit()"> <option><select a category></option> <option value="anniversary">Anniversary</option> <option value="eternity">Eternity</option> <option value="semi mount">Semi Mount</option> <option value="solitaire">Solitaire</option> <option value="trinity">Trinity</option> </select> </label> <label></label> </form></div> <div id="sort"> <form id="form2" name="form2" method="get" action="itemslisttest.php"> <select name="sorter" id="sorter" onchange="form2.submit()"> <option><sort by ...></option> <option value="items_number">Number</option> <option value="items_category">Category</option> <option value="items_available">Available</option> </select> </form> </div> <div id="listitems"> <table width="628" height="339" style="width: 100%; "> <?php require_once("connect.php"); $sorter = $_GET['sorter']; $mycatagory = $_GET['thiscatagory']; if($sorter==NULL) { $sorter = "items_category"; } if($mycatagory==NULL) { $mystuff = mysql_query("SELECT items_number, items_category,items_img,items_about,items_available FROM tbl_items ORDER BY ".$sorter." ASC"); }else{ $mystuff = mysql_query("SELECT items_number, items_category,items_img,items_about,items_available FROM tbl_items WHERE items_category = '".$mycatagory."' ORDER BY ".$sorter." ASC"); } while($row=mysql_fetch_array($mystuff)) { print "<tr><td width='50'><img src='".$row['items_img']."' width='50' height='50'/></td><td width='136'>".$row['items_category']."</td><td width='90'>".$row['items_number']."</td><td width='393'>".$row['items_about']."</td><td width='98'>".$row['items_available']."</td></tr>"; } ?> </table> </div> <div id="tabletitles"> <table width="651" height="22" border="0" align="center" style="width: 100%; "> <tr><td width="50"></td> <td width="136"><div align="center">Category</div></td> <td width="90"><div align="center">Item Number</div></td> <td width="393"><div align="center">About</div></td> <td width="98"><div align="center">Available</div></td> </tr> </table> </div> </div> <div id="footer"><br /> <a href="index.php">HOME</a> <a href="aboutus.php">ABOUT US</a> <a href="collections.php">COLLECTIONS</a> <a href="promotions.php"> PROMOTIONS</a> <a href="contact.php">CONTACT US</a> <a href="adminlogin.php">ADMIN LOGIN</a><br /> <br /> <br /> Copyright 2008 T&T Jewellers Inc. Design Plus. All Rights Reserved.<br /> Site design by Silhouette Design</div> <a href="contact.php"></a> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/144106-need-help-asap/#findComment-756156 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.