I have a very weird condition with my php script.
$qType = filter_input(INPUT_GET, 'qType', FILTER_SANITIZE_NUMBER_INT);
if ($qType == 1) {
..
elseif ($qType == 3) {
$prod = filter_input(INPUT_GET, 'prod', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
echo "prod = " . $prod;
if ($prod == "SiHy")
$strSQL = "SELECT * FROM dbo.table_s";
else
$strSQL = "SELECT * FROM dbo.table_fl";
..
}
echo $strSQL;
I called it this way:
http://localhost/new.php?qType=3&prod="SiHy"
And it always returns FROM dbo.table_fl. Even when I put the condition as != and put the table_fl on top, it always returns FROM dbo.table_s -> the second $strSQL value setting.
What happened? What am I doing wrong? Seems like the if is not working.
Thanks in advance, :rherry