php - Radio button $_POST -


how know value of clicked button

<input type="radio" name="radio">yes<br> <input type="radio" name="radio">no 

php part

$option1= $_post['radio']; 

when echo it say's "on".

you need give value attribute:

<input type="radio" name="radio" value="yes">yes<br> <input type="radio" name="radio" value="no">no 

Comments

Popular posts from this blog

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -