AndyXS Posted November 3, 2009 Share Posted November 3, 2009 This script should not allow $rating to be more than 10, yet for some reason its not working. Any ideas? if ($_GET['rating'] != "") { $min = 1; $max = 10; $rating = filter_var($_REQUEST['rating'], FILTER_VALIDATE_INT, array("min_range"=>$min, "max_range"=>$max)); if ($rating == "") { $errors .= 'Invalid Rating.<br /><br />'; } } else { $errors .= 'Invalid Rating.<br />'; } Link to comment https://forums.phpfreaks.com/topic/180053-integer-max-value/ Share on other sites More sharing options...
salathe Posted November 3, 2009 Share Posted November 3, 2009 Your specification of max/min is in the wrong format, it needs to be array("options" => array("min_range" => $min, "max_range" => $max)) Link to comment https://forums.phpfreaks.com/topic/180053-integer-max-value/#findComment-950082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.