On Thu, May 5, 2011 at 18:10, Michael Simiyu <simiyu.mich...@gmail.com> wrote:
> So i guess my question is how to configure a meu item in a drop down to be
> automatically selected in a link...


$cat_ids = array(1,3,5,7,13,15,24,36,81,92);

echo '<select name="categories">'.PHP_EOL;
foreach ($cat_ids as $cid) {

    echo '  <option value="'.$cid.'"';

    if (isset($_GET['cat_id']) && $_GET['cat_id'] == $cid) {
        echo ' selected="selected"';

    echo '">'.$cid.'</option>'.PHP_EOL;
echo '</select>'.PHP_EOL;

</Daniel P. Brown>
Network Infrastructure Manager

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to