I am trying to set a variable in an if statement so that only when the if statement is true, the variable will be set and will be able to be used further down on the page.
Here's what I have tried:
if ($row[8] == 1) {
echo 'Message here';
ob_start();
include('F164.php');
$f164 = ob_get_clean();
}
as well as:
if ($row[8] == 1) {
echo 'Message here';
$f164 = include('F164.php');
}
ob_start(); include('F164.php'); $f164 = ob_get_clean();the file simply does not show up. When using$f164 = include('F164.php');it does, but where it is declared, not where the variable is further down on the page.ifstatement have to do with this? The way you're trying to set the variable won't work outside theif, either.$f164toinclude('F164.php');only if$row[8] == 1.