PHP - Making Data Unselectable In A Dropdown List
I have a form created with code already written. I am in need of a push in the right direction or a potential tutorial on this issue i have. I am running a fanatsy golf website where the user will pick one golfer each week and the cannot select them again. Is there a way I can remove that data from the list for the next week when the user makes his selection or can I have that data another color and unselectable. If you want code, please let me know and i can provide it. Thanks in advance for your help.
p.s. the list data is stored in a MySQL database. Similar TutorialsHi, I am hoping someone can help me out with a slight issue I have with php and mySQL. I have an ajax-powered form with a select (dropdown) field populated through a php function. Based on the user-selected values in this field, data is displayed on the webpage; i.e. selected value 1 returns values x and y on the page. I am now trying to call additional data (value z) from a different table in the same database, and as before, use the selected values from the dropdown to display the data. For some reason, value z is not changing according to the user-selected value. This is my code: [The function to populate the select field] Code: [Select] function kfl_get_funds_names() { $result = array(); $result['CDF'] = 'Crosby Dragon Fund'; $result['CPF'] = 'Crosby Phoenix Fund'; $result['AMZPIF'] = 'AMZ Plus Income Fund'; $result['KASBIIF'] = 'KASB Islamic Income Opportunity'; $result['KASBCPGF'] = 'KASB Capital Protected Gold Fund'; $result['KASBLF'] = 'KASB Income Opportunity Fund'; $result['KASBCF'] = 'KASB Cash Fund'; $result['KASBBF'] = 'KASB Asset Allocation Fund'; $result['KASBSMF'] = 'KASB Stock Market Fund'; return $result; } [the code calling and using the function to interact with the database] Code: [Select] $funds_to_display = kfl_get_funds_names(); $current_symbol = key( $funds_to_display ); $current_nav_rates = kfl_get_latest_rates( $current_symbol ); [the code calling additional data, value z, from the database, and using the info in the select field to filter it] Code: [Select] $cutoff = kfl_cutoff( $current_symbol ); The display of each of these items is as follows: Code: [Select] <?php echo $current_nav_rates['nav_date']; ?> <?php echo $funds_to_display[$current_symbol]; ?> <?php echo $cutoff['cutoff']; ?> I can't get the $cutoff code to display the correct values. It picks up the first symbol to display and doesn't change with user selection. The code for the selection box, by the way: Code: [Select] <select id="dailynav-funds" autocomplete="off" name="dnf"> <?php foreach ($funds_to_display as $fund_symbol => $fund_name) { echo '<option'; if( $fund_symbol == $current_symbol ) { echo ' selected="selected"'; } echo ' value="' . $fund_symbol . '">'; echo $fund_name; echo '</option>'; } ?> </select> I've tried to get data using $_GET['dnf'] into the cutoff code, but that throws up parse errors. What am I doing wrong, and how can I resolve this issue? Thanks in advance! Hi? im just a beginner in php i just want to ask how to insert a data into a table from a dropdown list. I have concatenate the itemid and description to form the dropdown list. But when i viewed my item_table the itemid and description columns are null. can you help me with this.. this is my php code for the dropdown list... <?php $query = "SELECT CONCAT(itemid,' ', '-',' ', description) AS Item FROM item_table"; $result = mysql_query($query) or die(mysql_error()); $dropdown = "<SELECT CONCAT(itemid,' ' '-',' ', description) AS Item FROM item_table>"; while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['Item']}'>{$row['Item']}</option>"; } $dropdown .= "\r\n</select>"; echo $dropdown; ?> this my code for inserting data into the item_table... <?php if(isset($_POST ['submit'])) { $itemid = $_POST['itemid']; $description = $_POST['description']; $datein = $_POST['datein']; $qtyin = $_POST['qtyin']; $unitprice = $_POST['unitprice']; $unit = $_POST['unit']; $category = $_POST['category']; $empid = $_POST['empid']; $message =''; if(($itemid && $description == "")||($itemid && $description == null)) { header("location:IncomingEntry.php?msg=Incorrect"); exit(); } else { $link = mysql_connect('localhost', 'root', '') or die(mysql_error()); $db_selected = mysql_select_db('inventory', $link); $message=''; $query = "INSERT INTO incoming_table (itemid , description, datein, qtyin, unitprice, unit, category, empid) VALUES ('".$itemid."', '".$description."', '".$datein."', '".$qtyin."', '".$unitprice."', '".$unit."', '".$category."', '".$empid."')"; if (!mysql_query($query,$link)) { die('Error: ' . mysql_error()); } header("location: IncomingEntry.php?msg=1 record added"); } } ?> Some forum users here gave me great help yesterday in working with dropdown menus. In fact, I need quite a few of these dropdown menus in several forms over several pages, so I created several simple arrays and made a function to create the dropdowns. Here's one of my arrays: Code: [Select] <?php $instruments = array( 'Bassoon', 'Cello', 'Clarinet', 'Double Bass', 'Flute', 'French Horn', 'Oboe', 'Percussion', 'Trombone', 'Trumpet', 'Tuba', 'Viola', 'Violin', 'Other' ); Here's my function: Code: [Select] <?php function create_dropdown($array_name, $array_item) { echo "<select name='$array_item'>\n"; echo "<option value='select'>Select…</option>\n"; foreach( $array_name as $v ) { echo "<option value='$v'>" . $v . "</option>\n"; } echo "</select>\n"; } ... and anywhere I need a dropdown menu, I'm calling it like this: Code: [Select] <?php create_dropdown($instruments, 'instrument'); The dropdown menus, however (in some fairly detailed forms for my local youth orchestra's site), need to be sticky. How can I modify my function, above, so that the selected value will be retained if there are other form submission errors when the form is submitted? I have tried endlessly today but to no avail... If you can help while I still have some hair left, I'd be greatly appreciative. I'm new to this form and php/mysql so sorry if this isn't the right place to post this. This is what is in the first dropdown box. Code: [Select] $selValues['john'] = "a, b, c, d, e"; These are the different lists I want it to put in the second drop down box depending on what they choose in the first. Code: [Select] $selValues['list1']= " a1, a2, a3, a4, a5"; $selValues['list2']= " b1, b2, b3, b4, b5"; This is how I made an attempt to make it work before posting here. Along with plently of other ways. Code: [Select] if ($selValues['john']=a) { $chan_input = selectBuilder($selValues['$list1'] }; else if ($selValues['john']=b) { $chan_input = selectBuilder($selValues['$list2'] }; Basicly how I need it to work is there are two drop down boxes. First they will chose between a,b,c,d,e. If they chose a then on the second drop down box I only want them to be able to select a1,a2,a3,a4,a5. Now that i have my code that shows my list on the localhost I want to try and put this into a table and beable to add a delete from the table. Here's my code any help would be much appreciated. <?PHP // please add login and pass here// $host = "localhost"; $login = "root" ; $pass = ""; mysql_connect("$host","$login","$pass") OR DIE ("There is a problem with the system. Please notify your system administrator." .mysql_error()); //Seems in this case we can use a general call $connection = mysql_connect("$host","$login","$pass") or die(mysql_error()); $dbs = @mysql_list_dbs($connection)or die(mysql_error()); $db_list="<ul>"; $i =0; while ($i < mysql_num_rows($dbs)){ $db_names[$i] = mysql_tablename($dbs,$i); $db_list .="<li>$db_names[$i]"; $i++; } //Start Create DB// IF (isset($_POST['result'])){ $database=$_POST['database']; $sql="CREATE DATABASE $database "; $result = mysql_query($sql,$connection) or die(mysql_error()); echo "Database $database has been added"; } IF (isset($_POST['delete'])){ $db=$_POST['db']; $query=mysql_query("DROP DATABASE $db"); echo "Database $db has been deleted"; } ?> <html> <head> <title>MySQL Databases</title> </head> <body> <p><strong>Databases on localhost</strong>:</p> <? echo "$db_list"; ?> <?PHP //print_r($_POST); ?> <form action="pretask.php" method="post"> <select name="db"> <?PHP $db_list = mysql_list_dbs($connection); while ($row = mysql_fetch_object($db_list)) { //Here you are listing anything that should not be included if ($row->Database!="information_schema" && $row->Database!="mysql" && $row->Database!="phpmyadmin"){ echo "<option value=\"".$row->Database."\">".$row->Database."</option>"; } } ?> </select> <input type="submit" name="delete" value="Delete"/> </form> <form action="pretask.php" method="post"> Create Database <input type="text" name="database" /> <input type="submit" name="result" value="Create" /> </form> </body> Hi, I am trying to call the data from Mysql but I am getting an empty drop down list, this is the code: mysql: Code: [Select] create table years ( yearID integer auto_increment, year varchar(30), primary key (yearID) ); insert into years (yearID, year) values ('1', '2007-2008'); insert into years (yearID, year) values ('2', '2008-2009'); insert into years (yearID, year) values ('3', '2009-2010'); insert into years (yearID, year) values ('4', '2010-2011'); insert into years (yearID, year) values ('5', '2011-2012'); insert into years (yearID, year) values ('6', '2012-2013'); PHP: Code: [Select] <?php require_once('../Connections/connection.php'); ?> <?php $result = @mysql_query( "select yearID, year, from sss.years"); print "<p>Select a year:\n"; print "<select name=\"yearID\">\n"; while ($row = mysql_fetch_assoc($result)){ $yearID = $row[ 'yearID' ]; $year = $row[ 'year' ]; print "<option value=$yearID>$year\n"; } print "</select>\n"; print "</p>\n"; ?> Thank you! I'm pulling data from an xml file and I'm getting a lot of duplicates. How can I remove the duplicates from the query? Code: [Select] foreach($xml->category->subcategory as $category){ echo $category[id]; }//end foreach Hi. I am using this script to populate a dropdown list box from sql, it works but does anyone know how to sort the list in alphabetical order? $sql="SELECT * FROM Fish WHERE ***** = '".$_GET['stocktype']."'"; $result=mysql_query($sql); $options=""; while ($row=mysql_fetch_array($result)) { $ID=$row["ID"]; $Stock=$row["Commonn"]; $Options.="<OPTION VALUE=\"$ID\">".$Stock; } <SELECT NAME='stock1'> <OPTION VALUE='$Options'>$Options</option> </SELECT> This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=316599.0 Hey, I have the following coding: Quote <? $dbuser="*******"; $dbpass="*******"; $dbname="virtuda_db"; //the name of the database $chandle = mysql_connect("localhost", $dbuser, $dbpass) or die("Connection Failure to Database"); mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found. " . $dbuser); $mainsection="license"; $query1="select name from license"; $result = mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1); //do the query while($thisrow=mysql_fetch_row($result)) { $i=0; while ($i < mysql_num_fields($result)) { $field_name=mysql_fetch_field($result, $i); echo $thisrow[$i] . " "; //Display all the fields on one line $i++; } echo "<br>"; //put a break after each database entry } ?> How would I set up this so that instead of just "listing" them out on new lines, it would list the results into a drop down list? Thanks! If I can get this fixed, I will have completed all but the admin login for this project - my first php/mysql project. Here is what I need. I have a list_records.php that list all the records in the table 'links' and the category each entry is in from the table 'categories'. Here are my table structures. Code: [Select] -- Table structure for table `categories` -- DROP TABLE IF EXISTS `categories`; CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `categories` varchar(37) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=40 ; -- -------------------------------------------------------- -- -- Table structure for table `links` -- DROP TABLE IF EXISTS `links`; CREATE TABLE IF NOT EXISTS `links` ( `id` int(4) NOT NULL AUTO_INCREMENT, `catid` int(11) DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', `url` varchar(255) NOT NULL DEFAULT '', `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `catid` (`catid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=35 ; On the update.php file, I have a form that lets me make changes to the record. Here is the codes for update.php Code: [Select] <? include "menu.php" ?> <? include "db.php" ?> <?php $id=$_GET['id']; $sql = "select * from links where id =$id"; $query = mysql_query($sql); while ($row = mysql_fetch_array($query)){ $id = $row['id']; $catid = $row['catid']; $name = $row['name']; $url = $row['url']; $content = $row['content']; //we will echo these into the proper fields } mysql_free_result($query); ?> <table width="65%" align="center"> <tr><td align="left"> <form action="updated.php" method="post"> <input type="hidden" value="<?php echo $id; ?>" name="id"/> <br> <b>Website Name:</B><br> Change the name of the website listing.<br> <input type="text" value="<?php echo $name; ?>" name="name"/> <br> <br> <b>URL:</b><br> Change the URL of the website listing.<br> <input type="text" value="<?php echo $url; ?>" name="url"/> <br> <br> <b>Description:</b><br> Change the description of the website listing.<br> Limit 255 characters.<br/> <textarea name="content" cols="45" rows="4" wrap="soft"><?php echo($content);?></textarea> <br> <?php $result = mysql_query("SELECT id, categories FROM categories") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $id = $rows["id"]; $categories=$row["categories"]; $options.= '<option value="'.$row['id'].'">'.$row['id'].'-'.$row['categories'].'</option>'; }; ?> <SELECT NAME=catid> <OPTION VALUE=selected><? echo $catid; ?><? echo $options; ?></OPTION> </SELECT> <?php mysql_close(); ?> <div align="center"> <input type="submit" value="submit changes"/> </div> </form> <br> </td></tr></table> The part of he code I need help with is Code: [Select] <?php $result = mysql_query("SELECT id, categories FROM categories") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $id = $rows["id"]; $categories=$row["categories"]; $options.= '<option value="'.$row['id'].'">'.$row['id'].'-'.$row['categories'].'</option>'; }; ?> <SELECT NAME=catid> <OPTION VALUE=selected><? echo $catid; ?><? echo $options; ?></OPTION> </SELECT> I want it to default to the category that the entry is in. If you look, you will see in the select portion that I I have Code: [Select] <$ echo $catid; ?> which echos the proper category ID, but if I use Code: [Select] <? echo $categories; ?> it echos Writing, which is the last category in the list. Yet, the $options echo the catid and it corresponding category. How can I get the default option to echo BOTH the catid and category name while also listing all the other categories so that the records can be moved to a new category is needed? Any help will be appreciated. Thank you in advance. I'm trying to sort this dropdown box. It reads from a directory, and lists the file name in the dropdown box. Here's the tricky part... the filename is listed differently in the dropdown than in the directory by using explode(). I want to sort it though since it's still being sorted by the directory listings... For example: Filename starts out as: 123_abc_567.pdf then gets listed as abc_123_567.pdf in the dropdown, but it's still getting sorted as if it were 123_abc_567.pdf How can I do that? Here's my code: // Define the full path to folder from root $path = "C:/Work_Orders/"; // Open the folder $dir_handle = @opendir($path) or die("Unable to open $path"); echo "<form method=\"POST\" action='".$_SERVER['PHP_SELF']."' name='selectworkorder'><select name='ordernumber2'>"; // Loop through the files while ($file = readdir($dir_handle)) { //Remove file extension $ext = strrchr($file, '.'); if($ext !== false) { $file = substr($file, 0, -strlen($ext)); } if($file == "." || $file == ".." || $file == "index.php" ) continue; //explode file name $changedordernumber = explode("_",$file); //put in new order $changedordernumber = $changedordernumber[1]."_".$changedordernumber[0]."_".$changedordernumber[2]; $changedordernumber=trim($changedordernumber,"_"); //list options echo "<option name='$file' value='$file'>$changedordernumber</option>\n"; } echo "</select><input type='submit' value='Change' name='submit'/></form></div>"; // Close closedir($dir_handle); Hi i'm new to php. I want to get all the values of dropdown list on another page wether selected or not. I have the following code currently: Code: [Select] <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php print $item['view'] ?> <?php } ?> I would like to make the list a drop down with a link so that when a user selects, he goes to a new page. I tried the following: Code: [Select] <select name="select"> <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php $url = $node->field_buy_at[0]['url']; $store = $item['view']; ?> <? echo "<option value='$url'>$store</option>";?> <?php } ?> </select> I'm pretty sure it's this "$url = $node->field_buy_at[0]['url'];" that I don't have correct. Hey Guys, I know it may seem pretty simple, but im having trouble populating a drop down list. Here is my code at the moment, but what it's doing is displaying the names all in one value, where it should be in separate select values. *Note that i have only done it to the first one. See attachment. 'AntonMatt' are next to each other, they should be separate select values. Code: [Select] <? $id = $_GET['id']; $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team'"; $player=mysql_query($selectplayers); ?> <table class='lineups' width="560" cellpadding="5"> <tr> <td colspan="2">Starting Lineup</td> <td colspan="2">On the Bench</td> </tr> <tr> <td width="119"> </td> <td width="160"> </td> <td width="69"> </td> <td width="160"> </td> </tr> <tr> <td>Prop</td> <td><select name="secondary" style="width: 150px"> <option value='' selected="selected"><? while($rowplayer = mysql_fetch_array($player)) { echo $rowplayer['fname']; } ?></option> </select></td> <td>16.</td> <td><select name="secondary16" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> </tr> <tr> <td style="padding-top: 8px;">Hooker</td> <td style="padding-top: 8px;"><select name="secondary2" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> <td style="padding-top: 8px;">17.</td> <td style="padding-top: 8px;"><select name="secondary17" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> </tr> </table> </div> </div> i have been trying to get this code to get a list of usernames from a database and i have now got that to work but when i try and save it it saves all the usernames from the drop down list and not just the one i have selected how can i get it to just use the one i have selected Code: [Select] <?php include "connect.php"; //connection string include("include/session.php"); print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<table class='maintables'>"; print "<tr class='headline'><td>Post a message</td></tr>"; print "<tr class='maintables'><td>"; // Write out our query. $query = "SELECT username FROM users"; // Execute it, or return the error message if there's a problem. $result = mysql_query($query) or die(mysql_error()); $dropdown = "<select name='username'>"; while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['username']}'>{$row['username']}</option>"; } $dropdown .= "\r\n</select>"; if(isset($_POST['submit'])) { $name=$session->username; $yourpost=$_POST['yourpost']; $subject=$_POST['subject']; $to=$dropdown; if(strlen($name)<1) { print "You did not type in a name."; //no name entered } else if(strlen($yourpost)<1) { print "You did not type in a post."; //no post entered } else if(strlen($subject)<1) { print "You did not enter a subject."; //no subject entered } else { $thedate=date("U"); //get unix timestamp $displaytime=date("F j, Y, g:i a"); //we now strip HTML injections $subject=strip_tags($subject); $name=strip_tags($name); $yourpost=strip_tags($yourpost); $to=strip_tags($to); $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,name) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$to')"; mysql_query($insertpost) or die("Could not insert post"); //insert post print "Message posted, go back to <A href='forum.php'>Forum</a>."; } } else { print "<form action='newtopic.php' method='post'>"; print "Your name:<br>"; print "$session->username<br>"; print "User to send to:<br>"; print "$dropdown"; print "Subject:<br>"; print "<input type='text' name='subject' size='20'><br>"; print "Your message:<br>"; print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>"; print "<input type='submit' name='submit' value='submit'></form>"; } print "</td></tr></table>"; ?> MOD EDIT: Changed PHP manual link [m] . . . [/m] tags to [code] . . . [/code] tags. Alright, so I have an xml file differences.xml that is being parsed in XML. This is what the xml looks like: <item code="lM" name="dog"> <cost>5000</cost> <Start>12/15/2010</Start> <End>01/13/2011</End> </item> <item code="lF" name="cat"> <cost>5000</cost> <Start>04/15/2010</Start> <End>04/23/2011</End> </item>[/ I want to have the item names (dog, cat) show in a dropdown menu so that I can select these items for editing before storing in my mysql database. This is the php code I have so far: <?PHP $xml = simplexml_load_file("differences.xml"); $object = $xml->xpath("//item"); echo '<SELECT name=object>'; foreach ($object['name'] as $key => $value) { echo '<OPTION value='.$value.'> '.$value; } echo '</select>'; ?> I do have a dropdown list but there are no values inside it (it is empty). Can anyone help me figure out why? I do have this code that does work which lists the items in plaintext (not in a dropdown) so hopefull this will help us out: <?PHP $xml = simplexml_load_file("differences.xml"); $object = $xml->xpath("//item"); $count = count($object); $i = 0; while($i < $count) { echo '<h1>'.$object[$i]['name'].'</h1>'; $i++; } ?> Okay, really newbie question, but for this code... Code: [Select] <!-- Gender --> <label for="gender">Gender:</label> <select id="gender" name="gender"> <option value="">--</option> <option value="F">Female</option> <option value="M">Male</option> </select> 1.) How do I assign a variable to this? 2.) How do I make this "sticky"? Here is how I have usually done other form types... Code: [Select] <!-- First Name --> <label for="firstName">First Name:</label> <input id="firstName" name="firstName" type="text" maxlength="30" value="<?php if(isset($firstName)){echo htmlentities($firstName, ENT_QUOTES);} ?>" /><!-- Sticky Field --> <?php if (!empty($errors['firstName'])){ echo '<span class="error">' . $errors['firstName'] . '</span>'; } ?> Oh, by the way, at the top of my PHP file I have this code... Code: [Select] if ($_SERVER['REQUEST_METHOD']=='POST'){ // Form was Submitted (Post). // Initialize Errors Array. $errors = array(); // Trim all form data. $trimmed = array_map('trim', $_POST); Thanks, Debbie How to create Dependent Dropdown List?
<div class="form-group"> <label class="control-label col-sm-2" for="i_have">I have :</label> <div class="col-sm-10"> <select id="old" class="form-control" placeholder="Select I have" name="i_have"> <option value = "select_option">Select Option</option> <option value = "three_compact">3 Compact</option> <option value = "three_regular">3 Regular</option> <option value = "three_triple">3 Triple</option> <option value = "five_compact">5 Compact</option> <option value = "five_regular">5 Regular</option> <option value = "five_triple">5 Triple</option> <option value = "seven_compact">7 Compact</option> <option value = "seven_regular">7 Regular</option> <option value = "seven_triple">7 Triple</option> <option value = "nine_compact">9 Compact</option> <option value = "nine_regular">9 Regular</option> <option value = "nine_triple">9 Triple</option> </select> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="i_want">I want :</label> <div class="col-sm-10"> <select id="new" class="form-control" placeholder="Select I want" name="i_want"> <option value = "select_option">Select Option</option> <option value = "three_compact">3 Compact</option> <option value = "three_regular">3 Regular</option> <option value = "three_triple">3 Triple</option> <option value = "five_compact">5 Compact</option> <option value = "five_regular">5 Regular</option> <option value = "five_triple">5 Triple</option> <option value = "seven_compact">7 Compact</option> <option value = "seven_regular">7 Regular</option> <option value = "seven_triple">7 Triple</option> <option value = "nine_compact">9 Compact</option> <option value = "nine_regular">9 Regular</option> <option value = "nine_triple">9 Triple</option> </select> </div> </div>
If the first dropdown "3 Compact " is selected second dropdown should not be able to select "3 Compact" & if first dropdown "5 Regular" is selected second dropdown should not be able to select below values of 5 Regular like "3 Compact, 3 Regular, 3 Triple, 5 Compact. The logic is, if first dropdown value selects like 5, second dropdown value must select above 5 not 4 or 3 or 2 or 1. i have the following code: <td width='100px'>Suppliers <select name="supplier"> <?php $catcher_id = $service->getCatcherId(); $supplier_names = LpmAdnetworkPeer::getByName($catcher_id); foreach($supplier_names as $row) { ?> <option><?php echo $row->getName(); ?></option> <?php } ?> </select> </td> then on the same form i have a submit button that takes me to the next form..the problem now is how can i access the ID of the item seleted in the dropdown on the NEXT form please? i can get the name from the list by $_POST['supplier'] on the next form thanks |