Results 1 to 3 of 3

Thread: please help me

  1. #1
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default please help me

    i'm posting a form to itself and using the session to store values. the script doesn't insert/update any details to database if the criteria isn't met. that said, i have some check boxes that i can't get to work here is the code.

    this goes at the top of the script to set the session and gain the values.
    PHP Code:
    if(isset($_POST['activities'])) {$_SESSION['activities'] = $_POST['activities']; $activities =  $_SESSION['activities']; } else { $activities ""; } 
    these loops contain the checkboxes retrieving the data back from the database
    //Activity checkboxes tag
    PHP Code:
    $acti mysql_query("select * from activity order by activity");
    $html .= "<td  style='width:20%'>Activities:</td><td><table style='width:100%' class=login><tr>\n";

            
    $html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";
            for(
    $ok 1$ok <= mysql_num_rows($acti);$ok ++)
        { 
            
    $acy mysql_fetch_array($acti);
             
    $html .= "<input type=checkbox class=check name=activities[]  value=" $acy[0] . ($activities == $acy[0] ? " checked " "") . " /> $acy[1]<br>\n";
             if(
    $ok===4){break; $html .= "<tr></tr>"; continue;}                                 
        }                                                                                      
        
    $html .= "</td>";                                                                      
                                                                                               
        
    $html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";                          
            for(
    $ok 5$ok <= mysql_num_rows($acti);$ok ++)                                    
        {                                                                                      
            
    $acy mysql_fetch_array($acti);                                                     
             
    $html .= "<input type=checkbox class=check name=activities[]  value=" $acy[0] . ($activities == $acy[0] ? " checked " "") . " /> $acy[1]<br>\n";
             if(
    $ok===8){break; $html .= "<tr></tr>"; continue;}                                 
        }                                                                                      
        
    $html .= "</td>";                                                                      
                                                                                               
        
    $html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";                          
            for(
    $ok 9$ok <= mysql_num_rows($acti);$ok ++)                                    
        {                                                                                      
            
    $acy mysql_fetch_array($acti);                                                     
             
    $html .= "<input type=checkbox class=check name=activities[]  value=" $acy[0] . ($activities == $acy[0] ? " checked " "") . " /> $acy[1]<br>\n";
             if(
    $ok===12){break; $html .= "<tr></tr>"; continue;}                                
        }                                                                                      
        
    $html .= "</td>";                                                                      
                                                                                               
        
    $html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";                          
            for(
    $ok 13$ok <= mysql_num_rows($acti);$ok ++)                                   
        {                                                                                      
            
    $acy mysql_fetch_array($acti);                                                     
             
    $html .= "<input type=checkbox class=check name=activities[]  value=" $acy[0] . ($activities == $acy[0] ? " checked " "") . " /> $acy[1]<br>\n";
             if(
    $ok===16){break; $html .= "<tr></tr>"; continue;} 
        }
        
        
    $html .= "<input type=hidden value=" mysql_num_rows($acti) . " name=actlimit />\n";
        
    $html .= "</td>";

    $html .= "</tr></table></td></tr>\n"

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't think [] is allowed in an attribute value without being quoted.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanx i'll try that. safe bro

Bookmarks

Posting Permissions

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