hello everyone i have a problem
if(isset($_POST['submit'])) {$cars = $_POST['cars']; echo $cars;}
<form>
<input type="checkbox" name="cars[]" value="1" />
<input type="checkbox" name="cars[]" value="2" />
<input type="checkbox" name="cars[]" value="3" />
<input type="checkbox" name="cars[]" value="4" />
<button>add</button>
</form>
how can i stop changeing value if user change the input value from inspect element , or if user change the value alert me
i try this
$allowe = ['1','2','3','4'];
if(in_array($_POST['cars'],$allowe)) {echo $_POST['cars'];}
but is not working is only work for one value
Aucun commentaire:
Enregistrer un commentaire