validate input value of min and max

时间:2018-04-20 21:23:27

标签: php loops constants

I know this can be validated with HTML now, but also need to validate on PHP side.

<input type="number" name="startpoint" min="100000" max="999998">
<!-- input one, but will validate 2, this is `startpoint`, other is ending or `MAX_VALUE`-->

i essentially need to validate the same which is being validated above in my mark-up; but within PHP side.

while ($_POST['startpoint'] => 100000 || =< 999998) { 

    for (){ // run for loop

    }

}

1 个答案:

答案 0 :(得分:2)

Using wrong comparison operator.

while ($_POST['startpoint'] >= 100000 && $_POST['startpoint'] <= 999998) { 
相关问题