hello friends,
I want to display only those images which are checked.
I had tried so many times but no use.
when I checked any images. it displays only last image.
can any tell me where is the problem
here is the code.
display.php
<?php
$i=0;
$connect = mysql_connect('localhost','root','') or die("Not connected");
$select = mysql_select_db('demo_data', $connect) or die("Not selected");
//$result = "select * from 'demo_data'.'photo_info' ";
$count = mysql_query("select * from photo_info ");
//$record = mysql_num_rows($count);
//if($record >0){
while($r= mysql_fetch_array($count)){
$i++;
$name = $r;
echo '<img src= " '.$name.'" />';
?>
<form action="new.php" method="post" >
<input type="checkbox" name="selectimg[]" value="<?php echo $i; ?> "/>
<?php }
?>
<input type="submit" value="submit" name="fsub" />
</form>
show.php
<?php //mysql_close($hostn);
require_once ("display.php");
if(isset($_POST)){
$check = $_POST;
//$box = $check;
if(empty($check)){
echo "Not getting";
}
else{
$count = count($check);
$x=0;
for($i=0; $i<$count; $i++){
$v = $check[$i];
while($x < $count){
$x++;
echo '<img src= "'.$name.'" />' ;
}
}
}
}
?>