Been looking at this for ages but I can't figure out why it doesn't work:
Code: Select all
$collective = array ('man', 'cat', 'water');
foreach ($collective as $n) {
if ($n == 'cat') {
$_SESSION['val1'] = 'cat';
echo 'Success! '.$n.' found';
echo '<a href="doit.php? '. SID .' ">Do This</a>';
exit();
} else {
echo 'not found';
exit();
}Code: Select all
if ($n == 'cat') {Code: Select all
if ($n == 'man') {Where am I going wrong?