Well I thought so too, but Its not working.
I have loop thats inside of a form. It loops out all the products from the MySQL database. Each product has a checkbox beside it. check box is used to check wheter you want the product to go into the storefront. while the other checks wheter you just want to delete it.
I cant make each checkbox unique from one another so I made a varible called $i and I assigned it the INT 0. so it looks like below
<input type="checkbox" name="delete<?php echo $i; ?>" value="<?php echo $value;?>" />
<input type="checkbox" name="storeFront<?php echo $i; ?>" value="<?php echo $value;?>" />
Now If there already is value assigned into the check box then that already makes it a set varible right ?? So i couldnt check to see if it was set right ???
well let me show you the script
$i=0;
foreach ($_POST as $key => $val)
{
if (!isset($_POST['storefront'.$i])) //if storeFront is checked. then dont echo it out
{
echo $key." ".$val."</br>";
}
$i++;
}
its looping through the $POST . this loop is making a list to delete. if it notice that $POST['storeFront'] isset then it skips it and doesnt put the value that suppose to be deleted into the list.
TAKE NOTICE THAT this script isnt the actual script. its just an example that shows wheter it should execute the script within the if statement or not. In the real script it will add the value that isnt a storefront varible into the list to be deleted