Jump to content

helwo

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

helwo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am passing two fields through the url on selection through a dynamic form. However, it is only passing the first value on either selected field. The selections are in drop down boxes, what am I missing? [code] <body> <div id="findcleaner"> <div id="findhead">Find a Vacuum Cleaner </div> <div id="findcontent">   <p>Please select the purpose of your vacuum cleaning needs. </p>   <form name="form1" id="form1" method="post" action="store_items.php">     <table>              <?php do { ?>       <tr>         <td><a href="find_cleaner.php?cat_id=<?php echo $row_category['cat_id']; ?>"><?php echo $row_category['category']; ?></a></td>       </tr>       <?php } while ($row_category = mysql_fetch_assoc($category)); ?>     </table>     <p>Please select an area:       <select name="subcat">         <?php do {   ?>         <option value="<?php echo $row_subcat['subcat_id']?>"<?php if (!(strcmp($row_subcat['subcat_id'], $row_subcat['subcat_id']))) {echo "SELECTED";} ?>><?php echo $row_subcat['subcategory']?></option>         <?php } while ($row_subcat = mysql_fetch_assoc($subcat));   $rows = mysql_num_rows($subcat);   if($rows > 0) {       mysql_data_seek($subcat, 0);       $row_subcat = mysql_fetch_assoc($subcat);   } ?>       </select> </p>            <p>Please select your cleaning needs:       <select name="select">         <?php do {   ?>         <option value="<?php echo $row_subcat2['subcat_id']?>"<?php if (!(strcmp($row_subcat2['subcat_id'], $row_subcat2['subcat_id']))) {echo "SELECTED";} ?>><?php echo $row_subcat2['subcat2']?></option>         <?php } while ($row_subcat2 = mysql_fetch_assoc($subcat2));   $rows = mysql_num_rows($subcat2);   if($rows > 0) {       mysql_data_seek($subcat2, 0);       $row_subcat2 = mysql_fetch_assoc($subcat2);   } ?>       </select></p>       <p><a href="store_items.php?subcat_id=<?php echo $row_subcat['subcat_id']; ?>&subcat2_id=<?php echo $row_subcat2['subcat2_id']; ?>" target="_blank" onClick="window.close();">Submit</a> </p>   </form> </div> </div> </body> </html> <?php mysql_free_result($category); mysql_free_result($subcat); mysql_free_result($subcat2); ?> [/code]
  2. I have two fields in a table that I need filtering. The fields are passed but it does not filter subcat2_id? can anyone help? [code] <?php $colname_store_items = "1"; if (isset($_GET['subcat2_id'])) {   $colname_store_items = (get_magic_quotes_gpc()) ? $_GET['subcat2_id'] : addslashes($_GET['subcat2_id']); } $colname_store_items = "1"; if (isset($_GET['subcat_id'])) {   $colname_store_items = (get_magic_quotes_gpc()) ? $_GET['subcat_id'] : addslashes($_GET['subcat_id']); } mysql_select_db($database_vacuumshop, $vacuumshop); $query_store_items = sprintf("SELECT * FROM store_items WHERE subcat_id = %s AND store_items.subcat2_id", $colname_store_items); $store_items = mysql_query($query_store_items, $vacuumshop) or die(mysql_error()); $row_store_items = mysql_fetch_assoc($store_items); $totalRows_store_items = mysql_num_rows($store_items); ?> [/code]
  3. I have a form with an initial jump menu that dynamically populates the next two drop down boxes.On selection of the initial menu, the id is passed through the url. I want one box not to show if the initial option domestic is chosen. table is category, field name is category and cat_id the values are domestic =1 and commercial =2 [code] <?php if ($row_cat_id['category'] == "1")   { ?> <select name="problems"></select>    <?php } // Show if recordset empty ?>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.