You can use javascript to accomplish this.
before submitting the form call the function . something like
<html>
<head>
<script langauge='javascript'>
var currentItem;
var currentName;
var displayName;
function chkform()
{
displayName="";
for(i=0;i<10;i++)
{
currentItem="cname"+i;
currentName="name"+i;
if(eval("document.frmshopcart."+currentItem+".checked")==true)
{
displayName=displayName+ eval("document.frmshopcart."+currentName+".value")+","
}
}
document.frmshopcart.namelist.value=displayName
document.frmshopcart.submit();
}
</script>
</head>
<body>
<?php
echo"<form name=frmshopcart method=post action='validateshop.php'>";
for($i=0;$i<10;$i++)
{
$vname="name".$i;
$cname="cname".$i;
echo"Visitor Name: <input type=text name=".$vname."> ";
echo"Subscribe: <input type=checkbox name=".$cname."><br>";
}
echo"<input type=hidden name=namelist>";
echo"<input type=button value='submit' onclick='chkform()'>";
echo"</form>";
?>
</body>
now you have the concatenated with comma and in the resultant php you can
extract them...