What's wrong

From: Date: Tue, 01 Aug 2000 18:56:02 +0000
Subject: What's wrong
Groups: php.general 
Request: Send a blank email to php-general+get-9514@lists.php.net to get a copy of this message
Forgive me if this is a newbe question and asked before. Although I've been programming Perl (and other languages) for a long time, I'm new to PHP. The PHP Pocket Guide has code for a Intelligent Form Handling. I did a cut and paste from the O'Reilly page at: http://www.oreilly.com/catalog/phppr/chapter/php_pkt.html If an item from the select menu has not be chosen, an error message is display but the new menu does not have the previous selection highlighted. It would appear the offending code is in the snippet. Interests:
     <SELECT MULTIPLE NAME=interest[]>
     <?
      for($i=0, reset($interest);
          $i<count($options); $i++){
       echo "<OPTION";
       if(current($interest)==$options[$i]) {
        echo " SELECTED ";
        next($interest);
       }
       echo "> $options[$i]\n";
      }
     ?>
     </SELECT><BR>
Can someone please point me in the right direction with this code? Thanks a million. Urb

« previous php.general (#9514) next »