I have the following error handlers in my PHP file:
if (empty($title) || empty($description) || empty($price)) {
header("Location: ../listing1.php?error=emptyfields");
exit();
} elseif (!is_numeric($price)) {
header("Location: ../listing1.php?error=onlynumbers");
exit();
}
But when I type in accordance with the is_numeric
error handler it returns false telling it's error=emptyfields
. I have tried switching positions but it still returns false and now I'm lost, though when I type in anything above 0
it returns true.