Re: [PHP] Problem with selection

2002-08-09 Thread Jason Wong

On Friday 09 August 2002 12:16, [EMAIL PROTECTED] wrote:
 Could somebody look at this and tell me way it is not selecting the
 option fields in the $mins variable. I have looking at this all day
 and can not figure out what is wrong with it.

 ?php
 $mins=3,4,6,23,59;
 $ret=array_reverse(explode(',',$mins));
 $td = td valign=topselect name=\mins[]\ id=\mins\ size=\12\
 multiple; echo TABLE border=0tr;
 echo $td;
 for($i=0; $i60; $i++) {
 if($i=6) {
 echo option value=\$i\;
 if(isset($ret[$i]))

Use print_r($ret) to see why it's not working. Use array_search() or 
in_array() to make it work.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
An evil mind is a great comfort.
*/


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




[PHP] Problem with selection

2002-08-08 Thread rdkurth

Could somebody look at this and tell me way it is not selecting the
option fields in the $mins variable. I have looking at this all day
and can not figure out what is wrong with it.

?php
$mins=3,4,6,23,59;
$ret=array_reverse(explode(',',$mins));
$td = td valign=topselect name=\mins[]\ id=\mins\ size=\12\ multiple;
echo TABLE border=0tr;
echo $td;
for($i=0; $i60; $i++) {
if($i=6) {
echo option value=\$i\;
if(isset($ret[$i]))
echo ' selected';
echo $i/option;
}else{
echo option value=\$i\$i;
if(($i%11)==0)
echo /select/td \n\n $td;
}}
echo /td/tr/table/td;
?


-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


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