Toy Posted February 10, 2011 Share Posted February 10, 2011 Hey! I have a drop down field for my "register" form, but this is clearly easy to edit, I just used tamperdata for firefox and yeah...pretty easy, is there any way that you could prevent tampering with the values when submitting this form!? Quote Link to comment https://forums.phpfreaks.com/topic/227284-simple-question/ Share on other sites More sharing options...
johnny86 Posted February 10, 2011 Share Posted February 10, 2011 You have to filter your data once you receive it at the server end, simple example: <?php $valid_values = array('male', 'female'); if(in_array($_POST['data_to_validate'], $valid_values)) { echo "Your data is valid"; } else { echo "Your data is invalid"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/227284-simple-question/#findComment-1172381 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.