dimanche 9 août 2020

How to get checkbox value in php , but only if checkbox is checked [closed]

Hours passed but im still struggling at that point. i read many similar entries, tried suggestions but nothing's changed.

the form is:

<input type="checkbox" name="postipi" id="postipi" onchange="showWarning(this);">

php is :

echo $_POST['postipi'];

result is always on , case of checked or unchecked. i need to know if its checked or unchecked to switch to different codes. Or I need to read value of the checked box only (above form has no value, i tried it too) . What is wrong? Thank you.




Aucun commentaire:

Enregistrer un commentaire