checkbox checked PHP from webworks


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // page['special'] has 0, 1 or 2
  2. // 1 is home page, 2 is not displayed
  3.  
  4. $specials=array('Is Home Page','Does not appear in navigation');
  5. for($i=0;$i<count($specials);++$i){
  6. if($specials[$i]!=''){
  7. echo '<input type="checkbox" name="special[',$i,']"';
  8. if($page['special']&pow(2,$i))echo ' checked="checked"';
  9. echo ' />',$specials[$i],'<br />';
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.