Posted By

shinokada on 01/18/11


Tagged

checkbox


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

pytheas


checkbox checked PHP from webworks


 / Published in: PHP
 

  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
Posted By: shinokada on January 18, 2011

From webworks, book "CMS Design Using Php and jQuery"

You need to login to post a comment.