<?php
$a = $_POST['a'];
$b = $_POST['b'];
$c;
if(is_numeric($a) && is_numeric($b)){
echo "string";
exit();
}
if(!is_numeric($a) && !is_numeric($b)) {
echo "string";
exit();
}
if(isset($a)){
$resultat=$b*2.54;
echo "string " . $c . " string";
exit();
}
if(isset($b)){
$resultat=$a/2.54;
echo "string " . $c . " string";
exit();
}
?>
I start by checking wether form field 1 & 2 hold nummeric values, then i check if both hold values. That works fine, but when i get down to the second part, it never gets past the first "if" it always sees "a$" as set ...
Do i have to use case? or ?
empty
andisset
are different in PHP. A variable can be empty, but it is set if it is passed from your form. – Stan Jan 9 '13 at 18:03