How do I write php code to check if checkbox is checked or not? -


how write php code check if checkbox checked or not ? if checkbox selected yes value stored in database, , if checkbox not selected, no valued stored in database. how that? know how connect database etc.

<input type="checkbox" name="cb1" value="yes" />  $cb1 = ($_post['cb1'] == 'yes')?'yes':'no'; 

if checkbox not clicked value null i.e. variable $_post['cb1'] not set.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -