PHP validation function. Check for numeric and positive -


little confused how code this. user inputs numbers, validation checks make sure numeric , positive. user can leave field blank.

this have far, checks see inserted.

$error_blue = check_blue($phone); if($error_blue !=''){     print "<p>blue: $error_blue";     } 

is item validated @ top of page.

function check_blue($blue){ if(! is_numeric($blue)){     return'please enter valid number blue.'; }} 

is function is. on here appriciated.

something this?

function check_blue($blue) {     if (is_numeric($blue) && $blue > -1) {         return 1;     }     else {         return 0;     } }  if(!check_blue($phone)) {     return'please enter valid number blue.'; } 

see demo


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -