日期:2014-05-17 浏览次数:20472 次
<div id="<?php echo $widgets1 ?>"> A </div> <div id="<?php echo $widgets2 ?>"> B </div> 然后在CSS中设置: [code=CSS] #a { display:none; } #b { display:none; } #a1 { } #b1 { }
if(isset($_COOKIE['events'])) { $widgets1 = $_COOKIE['events']; } else { $widgets1 = "eventsshow"; } if(isset($_COOKIE['friends'])) { $widgets2 = $_COOKIE['friends']; } else { $widgets2 = "friendsshow"; } <fieldset> <legend>Widgets</legend> <input type="checkbox" value="eventsshow" <?php if($events == "eventsshow") echo "checked"; ?>></input> <label>events</label> <br/> <input type="checkbox" value="friendsshow" <?php if($friends == "friendsshow") echo "checked"; ?>></input> <label>friends</label> </fieldset> </form> <input type="submit"> ?>