Menu
I’m trying to do something very simple but can’t get my head around this.
I have a form with have two text inputs. ID1 & ID2.
On submit I want a few conditional statements.
First of all I want to check IF both are filled in. I then want to check that both are of type INT.
I’m doing that okay I think?
` if(empty( $_POST[‘IDOne’]) || empty($_POST[‘IDTwo’])){
Do I use is_int? Because any input will be a string, therefore I should convert it?
`if (is_int($_POST[‘IDOne’]) || is_int($_POST[‘IDTwo’])){
But If I convert to int
`$IDOne = (int) $_POST[‘IDOne’];
It gets a value 0 when not a int therefore becomes an INT.