You can do something like this:
<form action="receive.php" method="post"> <input type="radio" name="rad" value="one" /> One <br /> <input type="radio" name="rad" value="two" /> Two <br /> <input type="radio" name="rad" value="three" /> Three <br /> <input type="hidden" name="rad" value="null" /> <input type="submit" value="submit" /> </form>
Now, if you have not checked any switch, you will get the value "null", but remember that "null" not the same as NULL in PHP.
user1680049
source share