Guest Posted January 10, 2006 Posted January 10, 2006 Hello All, I have created a returns form here: Return form I want to replace the static product textfield I currently have in the form with a dynamic drop down list that has all the products in my database. An example of this can be found in the admin section, i.e. http://www.yoursite.co.uk/admin/products_attributes.php at the bottom left hand side. This will force the customer to choose the correct product. I have copied the code found in products_attributes.php, e.g. <select name="products_id"> <?php $products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name"); while($products_values = tep_db_fetch_array($products)) { if ($attributes_values['products_id'] == $products_values['products_id']) { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_name'] . '</option>'; } else { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>'; } } ?> </select> However when i replace the above code with the current static textfield I get php errors as follows: Parse error: parse error, unexpected '\"' in /home/voipon/public_html/includes/languages/english/returns.php on line 30 Can sombody please advise how I can change the code so that the dynamic product list is generated without getting php errors? Many thanks, Alec
Guest Posted January 10, 2006 Posted January 10, 2006 :( I thought this would be relativerly easy to implement into my form....surerly other people have wanted to insert prodict_id into new pages they have made??? Any Help would be much appreciated.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.