Hey, I feel like an idiot asking this, but my mind has gone blank, and its very annoying. How do i check what a user has entered in a form against some preset values? I have a drop down with 5 options and i want to make sure the person is using my form by checking they have chosen one of those 5 options and not something else. Thanks
$allowed = array('one value','another value','pie','cheese'); if ( ! in_array($_POST['selectname'],$allowed) ) { echo 'Not allowed'; } PHP: