Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: adding options

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    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!

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thx! Works great


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •