I have code for shuffling images and display.Now i want to values of checked boxes will store on database.please help
<?php
mysql_connect("localhost","root","");
mysql_select_db("impass");
?>
<html>
<body>
<form action="" method="post">
<?php
$images = array(
'<input name="chk1" type="checkbox" value="1" /><img src="images/images (4).jpg" alt="" width="234" height="212" />',
'<input name="chk2" type="checkbox" value="2" /><img src="images/images (6).jpg" alt="" width="234" height="212" />',
'<input name="chk3" type="checkbox" value="3" /><img src="images/images (5).jpg" alt="" width="234" height="212" />', '<input name="chk4" type="checkbox" value="4" /><img src="images/drt.jpg" alt="" width="234" height="212" />', '<input name="chk5" type="checkbox" value="5" /><img src="images/rf.jpg" alt="" width="234" height="212" />', '<input name="chk6" type="checkbox" value="6" /><img src="images/yu.jpg" alt="" width="234" height="212" />', '<input name="chk7" type="checkbox" value="7" /><img src="images/ed.jpg" alt="" width="234" height="212" />'
);
shuffle($images); // Randomize images array;
echo $images[0];
echo $images[1];
echo $images[2];
?>
<br /><br/><input name="s" type="submit" value="Submit Query" />
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$chk1=isset($_POST['chk1']);
$chk2=isset($_POST['chk2']);
$chk3=isset($_POST['chk3']);
$chk4=isset($_POST['chk4']);
$chk5=isset($_POST['chk5']);
$chk6=isset($_POST['chk6']);
$chk7=isset($_POST['chk7']);
$ins=mysql_query("insert into(images,image2,image3,image4,image5,image6,image7) values('$chk1','$chk2','$chk3','$chk4','$chk5','$chk6','$chk7')");
if($ins>0)
{ echo "sucess";
}
else
{
echo mysql_error();
}
}
?>