I'm trying to convert my php code embedded in html to php code with embedded html code. My IDE is throwing syntax errors. can someone please help, thanks.
html/php (working):
<select name="products">
<option value="select">Select</option>
<option value="product1" <?php if (!isset($updatebtn_clicked)){ echo @$product_list['product1']; }elseif ($_POST['products'] == $product_name[0]){ echo 'selected="selected"' ;} echo
'>'. $product_name[0]. '</option>' ?> </select>
The above is a snippet for a single item in my drop down list. They just keep repeating for all products and it works.
php/html (fails to work):
<?php
$select = '<select name="products">
<option value="select">Select</option>
value="'.$product_name[0].'"'.
if (!isset($updatebtn_clicked))
{ echo @$product_list[$product_name[1]]; }elseif ($_POST['products'] == $product_name[1]){ echo 'selected="selected"' ;} echo'>'. $product_name[1]. '</option></select>';
?>
the above generates a syntax error at the first if statement. I'm just not seeing why : /