Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2006, 03:48 PM   PM User | #1
Diod
New Coder

 
Join Date: Dec 2005
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Diod is an unknown quantity at this point
adding options

It doesnt add any options:

PHP Code:
    if ($settingsa['Text?'] == 0) {
        echo 
'<th width="455" scope="row"><select name="select">';
        
$ListVals explode(";"$settingsa['ListVals']);
        for (
$i 0$i == count($ListVals); $i++) 
        {
          echo 
'<option value="' $ListVals[$i] . '">' $ListVals[$i] . '</option>';
        }
        echo 
'</select></th>';
    } 
If i do
PHP Code:
    if ($settingsa['Text?'] == 0) {
        echo 
'<th width="455" scope="row"><select name="select">';
        
$ListVals explode(";"$settingsa['ListVals']);

          echo 
'<option value="' $ListVals[0] . '">' $ListVals[0] . '</option>';

        echo 
'</select></th>';
    } 
It does show the first element, but ofcourse not the second, why doesnt the first one work?
Diod is offline   Reply With Quote
Old 01-09-2006, 03:58 PM   PM User | #2
mlse
Regular Coder

 
mlse's Avatar
 
Join Date: Mar 2005
Posts: 624
Thanks: 20
Thanked 19 Times in 18 Posts
mlse is on a distinguished road
PHP Code:
if ($settingsa['Text?'] == 0) { 
        echo 
'<th width="455" scope="row"><select name="select">'
        
$ListVals explode(";"$settingsa['ListVals']); 
        for (
$i 0$i count($ListVals); $i++)    //You had "==" instead of "<"
        

          echo 
'<option value="' $ListVals[$i] . '">' $ListVals[$i] . '</option>'
        } 
        echo 
'</select></th>'
    } 
__________________
Die Welt ist ein Irrenhaus und hier ist die Zentrale!
mlse is offline   Reply With Quote
Old 01-10-2006, 11:39 AM   PM User | #3
Diod
New Coder

 
Join Date: Dec 2005
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Diod is an unknown quantity at this point
Thx! Works great
Diod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:09 AM.


Advertisement
Log in to turn off these ads.