MGLP Posted April 20, 2018 Share Posted April 20, 2018 In my form file I have [<input type=\"checkbox\" name=\"stove\" id=\"stove\" value=\"y\">] I use [method=\"POST\"] on Submit. In my next file I have [$stove=$_POST['stove'];] which works fine if the box was checked but if the box was not checked, I get error "Notice: Undefined index: stove in...." How can I test if the checkbox has been checked? Tks Link to comment Share on other sites More sharing options...
dsonesuk Posted April 21, 2018 Share Posted April 21, 2018 <?php $stove=""; if(isset($_POST['stove'])){ $stove=$_POST['stove']; } 1 Link to comment Share on other sites More sharing options...
MGLP Posted April 21, 2018 Author Share Posted April 21, 2018 Many thanks. Works beautifully! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now