hi guys please help, i've been stopped dead in my tracks on this development project. it was suppost to be simple but now the checkboxes have made it a nightmare. heres the php code. the form post everything back to this page and the conditions will evalute if the form is ready to go into the database, that bit is sorted but i cant get the values from the checkboxes into a string everyone says array but i keep getting errors if i use an array because i need the values back incase the user's form was submitted but failed to pass the conditions needed.
//sets the values in the session
//the checkboxesPHP Code:if(isset($_POST['scene'])) {$_SESSION['scene'] = $_POST['scene']; $scene = $_SESSION['scene']; } else { $scene = ""; }
please help....PHP Code:$html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";
for($sn = 1; $sn <= mysql_num_rows($sceti);$sn ++)
{
$scey = mysql_fetch_array($sceti);
$html .= "<input type=checkbox class=check name=\"scene[]\" value=\"$scey[1]\"" . ($scene == $scey[1] ? " checked " : "") . " /> $scey[1]<br>\n";
if($sn===4){break; $html .= "<tr></tr>"; continue;}
}
$html .= "</td>";
$html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";
for($sn = 5; $sn <= mysql_num_rows($sceti);$sn ++)
{
$scey = mysql_fetch_array($sceti);
$html .= "<input type=checkbox class=check name=\"scene[]\" value=\"$scey[1]\"" . ($scene == $scey[1] ? " checked " : "") . " /> $scey[1]<br>\n";
if($sn===8){break; $html .= "<tr></tr>"; continue;}
}
$html .= "</td>";
$html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";
for($sn = 9; $sn <= mysql_num_rows($sceti);$sn ++)
{
$scey = mysql_fetch_array($sceti);
$html .= "<input type=checkbox class=check name=\"scene[]\" value=\"$scey[1]\"" . ($scene == $scey[1] ? " checked " : "") . " /> $scey[1]<br>\n";
if($sn===12){break; $html .= "<tr></tr>"; continue;}
}
$html .= "</td>";
$html .= "<td align=\"left\" width=\"25%\" valign=\"top\" >";
for($sn = 13; $sn <= mysql_num_rows($sceti);$sn ++)
{
$scey = mysql_fetch_array($sceti);
$html .= "<input type=checkbox class=check name=\"scene[]\" value=\"$scey[1]\"" . ($scene == $scey[1] ? " checked " : "") . " /> $scey[1]<br>\n";
if($sn===16){break; $html .= "<tr></tr>"; continue;}
}
$html .= "<input type=hidden value=" . mysql_num_rows($sceti) . " name=scelimit />\n";
$html .= "</td>";



Reply With Quote
Bookmarks