hi guyz, i'm new to PHP and my first time to post here..
i would like to ask some help regarding CHECKBOXES..
..I'm havng problem on displaying the values of the checked checkboxes to other pages...how would i do that?
HERE IS MY CODE FOR THE FIRST PAGE:
<?php
$sql = "select * from tbl_services";
$query=@mysql_query($sql) or die("SQL Error");
while($row=@mysql_fetch_array($query))
{
$_i++; //increments the number in the tbl_services
echo "<tr >";
echo "<td>";
echo $row["ServiceCode"];
echo "</td>";
echo "<td>";
echo $row["ServiceName"];
echo "</td>";
echo "<td align='center'>";
echo "<input type='checkbox' name='check".$_i."' >";
echo "</td>";
echo "</tr >";
}
echo"<input type='hidden' name='ServiceID".$_i."' value='".$row["ServiceID"]."'>";
echo "<input type='hidden' names' value='".$_i."'>";
?>
MY CODE FOR THE ACTION PAGE:
<?php
ob_start();
require_once("header.php");
$_count=$_GET["count"];
$_service = $_POST["check"];
for($_i=1;$_i<=$_count;$_i++)
{
$_check=$_GET["check".$_i];
if($_check=="on")
{
$_ServiceID=$_GET["ServiceID".$_i];
echo $_ServiceID;
}
}
?>