Jump to content

[SOLVED] Select box


Schlo_50

Recommended Posts

Hi guys,

 

If there a way to say in php, if 'A' equals 'B' then don't display that row? I have a select box with the options generated using a loop and I don't want duplicate options to be displayed. So if $name equals $manname I don't want that row of data to be executed in my loop.

 

$get = $_GET['pid'];
$name = $_GET['name'];

print "<select name=\"manufacturer\" class=\"form\">";
print "<option value=\"$get$name\" selected=\"selected\">$name</option>";
$linesb = file("data/manufacturers.DAT");
foreach ($linesb as $lineb) { 
$datab = explode("|", $lineb);

$mid = trim($datab[0]);
$manname = trim($datab[1]);
    			  
print "<option value=\"$mid$manname\">$manname</option>";
}

print "</select>";

 

Thanks in advance for any help!

Link to comment
https://forums.phpfreaks.com/topic/108346-solved-select-box/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.