Jump to content

Codeman0013

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by Codeman0013

  1. I want to use unset($_POST['productCat_id']); to clear out my url if the user selects a new industry_id . Here is my code maybe you can help me understand where it goes... <form name="distributers" /> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td width="15%">Industry:</td> <td width="85%"> <select name="industry_id" id="industry" onchange="document.distributers.submit();"> <option value="">Select an Industry...</option> <?php do { ?> <?php print "<option value=\"{$row_rs_industry['industry_id']}\"" . (isset($_GET['industry_id']) && $_GET['industry_id'] == $row_rs_industry['industry_id'] ? " selected>" : ">") . "{$row_rs_industry['industry_name']}</option>\n";?> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?> </select> </td></tr> <tr><td>Product category:</td><td> <?php if ($_GET['industry_id'] == null || $_GET['industry_id'] == "") { ?> <select name="productCat_id" id="productcat" onchange="document.distributers.submit();" disabled>; <?php } else { mysql_select_db($database_conn_dj, $conn_dj); $query_rs_productcategory = "SELECT productCat_id, productCat_name, industry_id FROM tbl_productcat WHERE industry_id = '$_GET[industry_id]' ORDER BY productCat_name"; $rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error()); $row_rs_productcategory = mysql_fetch_assoc($rs_productcategory); $totalRows_rs_productcategory = mysql_num_rows($rs_productcategory); ?> <select name="productCat_id" id="productcat" onchange="document.distributers.submit();" > <option value="">Select a product category...</option> <?php do { print "<option value=\"{$row_rs_productcategory['productCat_id']}\"" . (isset($_GET['productCat_id']) && $_GET['productCat_id'] == $row_rs_productcategory['productCat_id'] ? " selected>" : ">") . "{$row_rs_productcategory['productCat_name']}</option>\n"; } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?> </select> <?php } ?></td> <tr><td>Product:</td><td> <?php if ($_GET['productCat_id'] == null || $_GET['productCat_id'] == "" || ($_GET['industry_id'] == null || $_GET['industry_id'] == "")) { ?> <select name="products_id" id="products" onchange="document.distributers.submit();" disabled>; <?php } else { mysql_select_db($database_conn_dj, $conn_dj); $query_rs_product = "SELECT products_id, products_name, productCat_id FROM tbl_products WHERE productCat_id = '$_GET[productCat_id]' ORDER BY products_name"; $rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error()); $row_rs_product = mysql_fetch_assoc($rs_product); $totalRows_rs_product = mysql_num_rows($rs_product); ?> <select name="products_id" id="products" onchange="document.distributers.submit();" > <option value="">Select a product...</option> <?php do { print "<option value=\"{$row_rs_product['products_id']}\"" . (isset($_GET['products_id']) && $_GET['products_id'] == $row_rs_product['products_id'] ? " selected>" : ">") . "{$row_rs_product['products_name']}</option>\n"; } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </select> <?php } ?> </td></tr> <tr><td> </td><td><input type="submit" value="Find" name="find"></td></tr> </table> </form>
  2. Hey right now my dropdown only submits one value but i also want it to submit a blank value for the next one as well which is the productCat_id drop down... <select name="industry_id" id="center" onchange="document.distributers.value='industry_id';document.distributers.submit();" how would i change that line to make that work?
  3. Hey maybe someone can help me with this i have tried all i know about it. I have 3 dropdowns all of which work correctly accept for one problem. When the user refreshes the first one and changes their choice it repopulates the second one like it should but the 3rd one isnt reset as well. How do i set the first one aka industry ot send a blank value to the url for both of the 2 corresponding menu's after it??? here is my code.. <?php require_once('Connections/conn_dj.php'); ?><?phpmysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT industry_id, industry_name FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);?><!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><title>DICKEY-john Corporation | Distributors</title><link href="_lib/sub.css" rel="stylesheet" type="text/css" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" /><meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." /></head><body> <div id="black"> </div><div id="siteContainer"> <?php include("_inc/topNav.inc"); ?> <div id="headerContainer">Distributors</div> <div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div> <div id="contentContainer"> <div id="fullContainer"> <div id="stretchCrumbs"> <a href="/index.php">Home</a> » <a class="high" href="/distributors/">Distributors</a> </div> <h1>Distributors</h1> <p>Search for DICKEY-john distributers by specifying any combination of the<br /> following classifications: industry, product category, product, and state.</p> <br /> <br /> <h2>North America</h2> <form name="distributers"> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td width="15%">Industry:</td> <td width="85%"> <select name="industry_id" id="industry" onchange="document.distributers.value='industry';document.distributers.submit();" > <option value="">Select an Industry...</option> <?php do { ?> <?php print "<option value=\"{$row_rs_industry['industry_id']}\"" . (isset($_GET['industry_id']) && $_GET['industry_id'] == $row_rs_industry['industry_id'] ? " selected>" : ">") . "{$row_rs_industry['industry_name']}</option>\n";?> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?> </select></td></tr> <tr><td>Product category:</td><td> <?php if ($_GET['industry_id'] == null || $_GET['industry_id'] == "") { ?> <select name="productCat_id" id="center" onchange="document.distributers.value='productCat_id';document.distributers.submit();" disabled>; <?php } else { mysql_select_db($database_conn_dj, $conn_dj); $query_rs_productcategory = "SELECT productCat_id, productCat_name, industry_id FROM tbl_productcat WHERE industry_id = '$_GET[industry_id]' ORDER BY productCat_name"; $rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error()); $row_rs_productcategory = mysql_fetch_assoc($rs_productcategory); $totalRows_rs_productcategory = mysql_num_rows($rs_productcategory); ?> <select name="productCat_id" id="center" onchange="document.distributers.value='productCat_id';document.distributers.submit();" > <option value="">Select a product category...</option> <?php do { print "<option value=\"{$row_rs_productcategory['productCat_id']}\"" . (isset($_GET['productCat_id']) && $_GET['productCat_id'] == $row_rs_productcategory['productCat_id'] ? " selected>" : ">") . "{$row_rs_productcategory['productCat_name']}</option>\n"; } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?> </select> <?php } ?></td> <tr><td>Product:</td><td> <?php if ($_GET['productCat_id'] == null || $_GET['productCat_id'] == "" || $_GET['industry_id'] == null || $_GET['industry_id'] == "") { ?> <select name="product_id" id="center" onchange="document.distributers.value='products_id';document.distributers.submit();" disabled>; <?php } else { mysql_select_db($database_conn_dj, $conn_dj); $query_rs_product = "SELECT products_id, products_name, productCat_id FROM tbl_products WHERE productCat_id = '$_GET[productCat_id]' ORDER BY products_name"; $rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error()); $row_rs_product = mysql_fetch_assoc($rs_product); $totalRows_rs_product = mysql_num_rows($rs_product); ?> <select name="products_id" id="center" onchange="document.distributers.value='products_id';document.distributers.submit();" > <option value="">Select a product...</option> <?php do { print "<option value=\"{$row_rs_product['products_id']}\"" . (isset($_GET['products_id']) && $_GET['products_id'] == $row_rs_product['products_id'] ? " selected>" : ">") . "{$row_rs_product['products_name']}</option>\n"; } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </select> <?php } ?> </td></tr> <tr><td> </td><td><input type="submit" value="Find" name="find"></td></tr> </table> </form> <br /> <h2>Outside North America </h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td> <select name="outna" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a country...</option> <?php do { ?> <?php print "<option value=\"{$row_rs_outsidena['id']}\"" . (isset($_GET['id']) && $_GET['id'] == $row_rs_outsidena['id'] ? " selected>" : ">") . "{$row_rs_outsidena['name']}</option>\n";?> <?php } while ($row_rs_outsidena = mysql_fetch_assoc($rs_outsidena)); ?> </select> </td></tr> </table> </form> </div> </div> <?php include("_inc/footer.inc"); ?></body></html><?phpmysql_free_result($rs_industry);mysql_free_result($rs_productcategory);mysql_free_result($rs_product);mysql_free_result($rs_outsidena);?>
  4. Hey is it possible to run a query and not allow the others to run until the ones above it have been executed like on page load i only want one thing to load and as the user submits then run the next on and so on here is my code if its possible ot change it i would appreciate any tips.. mysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT industry_id, industry_name FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT productCat_id, productCat_name, industry_id FROM tbl_productcat WHERE industry_id = '$_GET[industry_id]' ORDER BY productCat_name";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT products_id, products_name, productCat_id FROM tbl_products WHERE productCat_id = '$_GET[productCat_id]' ORDER BY products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);
  5. Hey I'm having a slight problem with my query of my php databse. It works but for some reason the code is messing up my css and totally enlarging the text until it submits the first time. After the first submit it works fine everything goes back to normal? here is my code any suggestions? mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT productCat_id, productCat_name, industry_id FROM tbl_productcat WHERE industry_id = '$_GET[industry_id]' ORDER BY productCat_name";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT products_id, products_name, productCat_id FROM tbl_products WHERE productCat_id = '$_GET[productCat_id]' ORDER BY products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);
  6. Codeman0013

    strange error

    now i get ... Parse error: syntax error, unexpected '{', expecting ',' or ';' in /u/internet/com/dickeyjohn/test.php on line 76and <?php do { ?> <option value="<?=$row_rs_industry['industry_id'];?>"<?=(isset($_GET['industry_id']) && $_GET['industry_id'] == $row_rs_industry['industry_id']) { ?> selected<?php } ?>><?=$row_rs_industry['industry_name'];?></option> thats the line of code
  7. Hey on one of my projects i keep getting undefined indexes because the user has to select a drop down value first how do i just give it a fake value like test or something ahead of time??
  8. Hey I have 3 questions in one here. First off when my dropdowns submit their value and the page refreshes they go back to their original value which says select a value but I want them to stay on the value the user selects. Also if the user refreshes the page or changes the value of one of the dropdowns I want all the corresponding ones below to automatically repopulate. Finally I want them to be disabled until a user selects the value that will populate it and I am having issues with the if loops. Can someone look at this code and help me with this stuff? <form name="distributers"> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td>Industry:</td><td> <select name="industry_id" id="industry" onchange="document.distributers.value='industry';document.distributers.submit();" > <option value="">Select an Industry...</option> <?php do { ?> <option value="<?php echo $row_rs_industry['industry_id']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?> </select></td></tr> <tr><td>Product category:</td><td> <select name="productCat_id" id="center" onchange="document.distributers.value='productCat_id';document.distributers.submit();" > <option value="">Select a product category...</option> <?php do { ?> <option value="<?php echo $row_rs_productcategory['productCat_id']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option> <?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?> </select> <tr><td>Products:</td><td> <select name="product" id="center" onchange="document.distributers.value='products_id';document.distributers.submit();" > <option value="">Select a product...</option> <?php do { ?> <option value="<?php echo $row_rs_product['products_id']; ?>"><?php echo $row_rs_product['products_name']; ?></option> <?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </select> <tr><td>State:</td><td> <select name="state" id="center" > <option value="">Select a state...</option> <?php do { ?> <option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option> <?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?> </select> </td></tr> <tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr> </table> </form>
  9. that didnt work grr i tried some more things this is really annoying lol here is my code <?php require_once('Connections/conn_dj.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}mysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT * FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT * FROM tbl_productcat WHERE industry = ".$_GET['industry_id']."";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT * FROM tbl_products ORDER BY tbl_products.products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_state = "SELECT * FROM tbl_states ORDER BY tbl_states.`state`";$rs_state = mysql_query($query_rs_state, $conn_dj) or die(mysql_error());$row_rs_state = mysql_fetch_assoc($rs_state);$totalRows_rs_state = mysql_num_rows($rs_state);?><!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><title>DICKEY-john Corporation | Distributors</title><link href="_lib/sub.css" rel="stylesheet" type="text/css" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" /><meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." /></head><body> <div id="black"> </div><div id="siteContainer"> <?php include("_inc/topNav.inc"); ?> <div id="headerContainer">Distributors</div> <div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div> <div id="contentContainer"> <div id="fullContainer"> <div id="stretchCrumbs"> <a href="/index.php">Home</a> » <a class="high" href="/distributors/">Distributors</a> </div> <h1>Distributors</h1> <p>Search for DICKEY-john distributers by specifying any combonation of the<br /> following classifications: industry, product category, product, and state.</p> <br /> <br /> <h2>North America</h2> <form name="distributers"> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td>Industry:</td><td> <select name="industry" id="industry" onchange="document.distributers.value='industry';document.distributers.submit();" > <option value="">Select an Industry...</option> <?php do { ?> <option value="<?php echo $row_rs_industry['industry_id']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?> </select></td></tr> <tr><td>Product category:</td><td> <select name="prodcat" id="center" disabled> <option value="">Select a product category...</option> <?php do { ?> <option value="<?php echo $row_rs_productcategory['productCat_name']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option> <?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?> </select> <tr><td>Products:</td><td> <select name="product" id="center" disabled > <option value="">Select a product...</option> <?php do { ?> <option value="<?php echo $row_rs_product['products_name']; ?>"><?php echo $row_rs_product['products_name']; ?></option> <?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </select> <tr><td>State:</td><td> <select name="state" id="center" disabled > <option value="">Select a state...</option> <?php do { ?> <option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option> <?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?> </select> </td></tr> <tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr> </table> </form> <br /> <h2>Outside North America </h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td> <select name="outna" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a country...</option> <?php do { ?> <option value="<?php echo $row_rs_ousidena['name']; ?>"><?php echo $row_rs_outsidena['name']; ?></option> <?php } while ($row_rs_outsidena = mysql_fetch_assoc($rs_outsidena)); ?> </select></td> </tr></td></tr> </table> </form> </div> </div><?php include("_inc/footer.inc"); ?></body></html><?phpmysql_free_result($rs_industry);mysql_free_result($rs_productcategory);mysql_free_result($rs_product);mysql_free_result($rs_outsidena);mysql_free_result($rs_state);?>
  10. Hey guys this might be just a noob question but in my sql query for the database how do i set it to say like where industry = and then the id number from the url for its query?
  11. i dont know what else to do with this statement its annoying the ###### out of me it should work but as soon as i put that code in there it kills it. I have to move on to making this database dependent but i have no idea what i'm doing this is above my head but i have no help on it grrr
  12. <form id="search" method="GET" action="/search/index.php"> <input id="searchBox" type="text" name="zoom_query" value="Search" onFocus="clearText(this)"/> <input type="hidden" name="zoom_and" value="1" /> <input id="searchSubmit" type="image" src="/_img/arrow_search.jpg" alt="site search arrow" /> </form> Something in that line is what is causing my problem when i remove it from the page it works again!
  13. I figured it out but now i have to get the database working thats going to be the hard part. The js works but nothign else is up and going yet...
  14. Ok i'm having problems now when i put my include in for the navigation it kills my js and it does not work but as soon as i take it off it works again i'm going to attach both for you to look at maybe someone can figure out what the heck is going on..<!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><title>DICKEY-john Corporation | Distributors</title><link href="_lib/sub.css" rel="stylesheet" type="text/css" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" /><meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." /><script language="javascript" src="chainedselects.js"></script><script language="javascript" src="exampleconfig.js"></script></head><body onload="initListGroup('vehicles', document.forms[0].make, document.forms[0].type, document.forms[0].model)"><div id="black"> </div><div id="siteContainer"> <?php include("_inc/topNav.inc"); ?><div id="headerContainer">Distributors</div> <div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div> <div id="contentContainer"> <div id="fullContainer"> <div id="stretchCrumbs"> <a href="/index.php">Home</a> » <a class="high" href="/distributors/">Distributors</a> </div> <h1>Distributors</h1> <p>Search for DICKEY-john distributers by specifying any combonation of the<br /> following classifications: industry, product category, product, and state.</p> <br /> <h2>North America</h2><table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"><tr><td><form><table align="center"><tr><td>Industry:</td><td><select name="make"></select></td></tr><tr><td>Product Category: </td><td><select name="type"></select></td></tr><tr><td>Product:</td><td><select name="model"></select></td></tr><td><input type="button" value="Reset" onclick="resetListGroup('vehicles')"></tr></table></form></body></html> here is the include file.. <script> function clearText(thefield){ if (thefield.defaultValue==thefield.value) thefield.value = "" } </script><div id="menuContainer"> <form id="search" method="GET" action="/search/index.php"> <input id="searchBox" type="text" name="zoom_query" value="Search" onFocus="clearText(this)"/> <input type="hidden" name="zoom_and" value="1" /> <input id="searchSubmit" type="image" src="/_img/arrow_search.jpg" alt="site search arrow" /> </form> <div id="topTidbits"><!--ZOOMSTOP--> <a href="/index.php">Home</a> | <a href="/aboutus/">About Us</a> | <a href="/pressroom/">Pressroom</a> | <a href="/shows/">Trade Shows</a> | <a href="/employment/">Employment</a> | <!--<a href="/pressroom/catalogs/">Catalogs</a> |--> <a href="/sitemap/">Site Map</a><!--ZOOMRESTART--></div> <table id="navTbl" border="0" cellpadding="0" cellspacing="0"> <tr><!--ZOOMSTOP--> <td class="nav"><a href="/products/">PRODUCTS</a></td> <td class="nav"><a href="/distributors/">DISTRIBUTORS</a></td> <td class="nav"><a href="/full-circle-manufacturing/">FULL CIRCLE MANUFACTURING</a></td> <td class="nav navEnd"><a href="/contact/">CONTACT US</a></td> <!--ZOOMRESTART--> </tr> </table> </div>
  15. well right now its the last thing but its static the boss wnats it last for some reason dont ask me man but i'm just going with what he said
  16. yes the database is created and there is going to be approximately 4 dropdowns one for the industry which is populated at the beginning and after they select the industry it moves to the product category which then will populate the product menu which then populates the state menu(will have all states no matter what) and then the user will click the find button and it will then list all the matching results...
  17. Yes you are exactly right in all of your assumptions so far i have been making it hardcoded but it needs to be driven based on the database could you help me do this? I have no idea where to start i have 2 seperate pages one that pulls all the items and one thats hard coded just what should be in each one can you help me take the ones i just made using your code and have them pull based on the database please
  18. Thank you chronthenoob that helps me a lot i have it hardcoded now but is it possible to make this into a database driven list?
  19. Hey guys i have a select menu that i would like to on change submit its value to the page test2.php and on page 2 the value will populate the next select list any help?
  20. that wont work the boss is the only programmer here and he wont do it or help me do it
  21. Hey guys, How would I make my page I have connect to a database using javascript dependent dropdowns? I have all the things I need to get the database working where it displays all the info in the database but I only want it to display based on what they select not all of it. Here is my page any help would be greatly appreciated. <?php require_once('Connections/conn_dj.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}mysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT * FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT * FROM tbl_productcat ORDER BY tbl_productcat.productCat_name";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT * FROM tbl_products ORDER BY tbl_products.products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_state = "SELECT * FROM tbl_states ORDER BY tbl_states.`state`";$rs_state = mysql_query($query_rs_state, $conn_dj) or die(mysql_error());$row_rs_state = mysql_fetch_assoc($rs_state);$totalRows_rs_state = mysql_num_rows($rs_state);?><!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><title>DICKEY-john Corporation | Distributors</title><link href="_lib/sub.css" rel="stylesheet" type="text/css" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" /><meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." /></head><body><div id="black"> </div><div id="siteContainer"> <?php include("_inc/topNav.inc"); ?> <div id="headerContainer">Distributors</div> <div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div> <div id="contentContainer"> <div id="fullContainer"> <div id="stretchCrumbs"> <a href="/index.php">Home</a> » <a class="high" href="/distributors/">Distributors</a> </div> <h1>Distributors</h1> <p>Search for DICKEY-john distributers by specifying any combonation of the<br /> following classifications: industry, product category, product, and state.</p> <br /> <br /> <h2>North America</h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td>Industry:</td><td> <select name="industry" id="center"> <option value="">Select an Industry...</option> <?php do { ?> <option value="<?php echo $row_rs_industry['industry_name']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?> </select></td></tr> <tr><td width="125">Product Category: </td> <td> <select name="prodcat" id="center"> <option value="">Select a product category...</option> <?php do { ?> <option value="<?php echo $row_rs_productcategory['productCat_name']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option> <?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?> </select></td></tr> <tr> <td>Product:</td> <td> <select name="prod" id="center"> <option value="">Select a product...</option> <?php do { ?> <option value="<?php echo $row_rs_product['products_name']; ?>"><?php echo $row_rs_product['products_name']; ?></option> <?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </select> </td></tr> <td>State:</td> <td> <select name="state" id="center"> <option value="">Select a state...</option> <?php do { ?> <option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option> <?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?> </select></td> </tr> <tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr> </table> </form> <br /> <h2>Outside North America </h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td> <select name="outna" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a country...</option> <?php do { ?> <option value="<?php echo $row_rs_ousidena['name']; ?>"><?php echo $row_rs_outsidena['name']; ?></option> <?php } while ($row_rs_outsidena = mysql_fetch_assoc($rs_outsidena)); ?> </select></td> </tr></td></tr> </table> </form> </div> </div><?php include("_inc/footer.inc"); ?></body></html><?phpmysql_free_result($rs_industry);mysql_free_result($rs_productcategory);mysql_free_result($rs_product);mysql_free_result($rs_outsidena);mysql_free_result($rs_state);?>
  22. wow i'm totally lost and this is way over my head still thanks for trying to help i'm totally lost and they just keep getting on me to do this thats y i'm not a webprogrammer i dont have a clue how to do this...
  23. wow this is way over my head nice of the freaking people to assign this to an intern who has no idea how to do it would you have anywhere i could look to learn how to do this?
  24. Hello, i'm working on a website and i have 4 dropdown's that are on a page and i want to make them dependent. Right now i have them set to pull from the database but i want it set to based on what they select on number 1 it populates number 2 and number 2 populates 3 and 3 does 4 and so on. Can someone take a look at my code and help me to achieve this as i have never done it before and would appreciate any help at all.. <?php require_once('Connections/conn_dj.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}mysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT * FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT * FROM tbl_productcat ORDER BY tbl_productcat.productCat_name";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT * FROM tbl_products ORDER BY tbl_products.products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_state = "SELECT * FROM tbl_states ORDER BY tbl_states.`state`";$rs_state = mysql_query($query_rs_state, $conn_dj) or die(mysql_error());$row_rs_state = mysql_fetch_assoc($rs_state);$totalRows_rs_state = mysql_num_rows($rs_state);?><!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><title>DICKEY-john Corporation | Distributors</title><link href="_lib/sub.css" rel="stylesheet" type="text/css" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" /><meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." /></head><body><div id="black"> </div><div id="siteContainer"> <?php include("_inc/topNav.inc"); ?> <div id="headerContainer">Distributors</div> <div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div> <div id="contentContainer"> <div id="fullContainer"> <div id="stretchCrumbs"> <a href="/index.php">Home</a> » <a class="high" href="/distributors/">Distributors</a> </div> <h1>Distributors</h1> <p>Search for DICKEY-john distributers by specifying any combonation of the<br /> following classifications: industry, product category, product, and state.</p> <br /> <br /> <h2>North America</h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td>Industry:</td><td> <select name="industry" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select an Industry...</option> <?php do { ?> <option value="<?php echo $row_rs_industry['industry_name']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option> <?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?></td></tr> </select> <tr><td width="125">Product Category: </td> <td> <select name="prodcat" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a product category...</option> <?php do { ?> <option value="<?php echo $row_rs_productcategory['productCat_name']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option> <?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?></td></tr> </select> <tr> <td>Product:</td><td> <select name="prod" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a product...</option> <?php do { ?> <option value="<?php echo $row_rs_product['products_name']; ?>"><?php echo $row_rs_product['products_name']; ?></option> <?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?> </td></tr> </select> <td>State:</td> <td> <select name="state" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a state...</option> <?php do { ?> <option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option> <?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?> </td></tr> </select></td> </tr> <tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr> </table> </form> <br /> <h2>Outside North America </h2> <table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr><td> <select name="outna" id="center" onchange="java script:document.centerform.submit()"> <option value="">Select a country...</option> <?php do { ?> <option value="<?php echo $row_rs_ousidena['name']; ?>"><?php echo $row_rs_outsidena['name']; ?></option> <?php } while ($row_rs_outsidena = mysql_fetch_assoc($rs_outsidena)); ?> </td></tr> </select></td> </tr></td></tr> </table> </form> </div> </div><?php include("_inc/footer.inc"); ?></body></html><?phpmysql_free_result($rs_industry);mysql_free_result($rs_productcategory);mysql_free_result($rs_product);mysql_free_result($rs_outsidena);mysql_free_result($rs_state);?>
  25. Hey guys i'm trying to update another site that was designed in 2004 and very outdated on the page for contact it has the following line: <?phpif ($_SESSION['inquirySuccess']) {echo "<tr><td valign=\"top\" colspan=\"2\" bgcolor=\"#FFFF99\"><p><strong>Thank you for your question.<br /> A Brintlinger and Earl representative will be in contact with you shortly.</strong></p></td><td> </td></tr><tr><td> </td><td> </td><tr>"; session_unset();session_destroy();}?> This line throws the error:Notice: Undefined index: inquirySuccess in /u/internet/com/brintlinger-earl/includes/content/submit_contact.php on line 6My question is why does it have this error, and how can i get rid of it?
×
×
  • Create New...