Possible Duplicate:
Alphabetic equivalent of PHP is_numeric
If you check if the data is a number, we use is_numeric:
if(!isset($_POST['rnum'])||trim($_POST['rnum'])==""){echo "Error:Enter Room Number!";
echo '<input type="button" value="Back" onClick="history.go(-1);return true;">';
}else if(!is_numeric(trim($_POST['rnum']))){echo "Error: Enter A Numeric Value!";
echo '<input type="button" value="Back" onClick="history.go(-1);return true;">';
die();
}
How about checking if it is string?or expecting that the inputted data are just letters