Returns ‘t2,’ as expected:
[code]
$c=1;
$thisCookie = ‘tbl’.$c;
if (isset($_COOKIE[$thisCookie]))
{
$newTable = ‘t’.($c+1);
}
else
{
$newTable = ‘cookie tbl1 was not found’;
}
echo (“<script>alert(‘”.$newTable.”‘);</script>”);
Returns nothing (null alert), as if the ‘for’ loop is not even activated. This is [b]not
[code]
for ($c=1; $y=”; $c++)
{
$thisCookie = ‘tbl’.$c;
if (isset($_COOKIE[$thisCookie]))
{
$newTable = ‘t’.($c+1);
}
else
{
$y=’y’;
}
}
echo (“<script>alert(‘”.$newTable.”‘);</script>”);
I’m simply trying to create a variable one increment greater than that of the highest valued cookie (eg, if tbl4 is found, I want to create $newTable=t5). Is there something wrong with my approach/syntax???
Thank you very much for any assistance that you can provide,
bubbis