fork(1) download
  1. <?php
  2. $value = 'yes';
  3. echo "<input type='checkbox' name='subscribe' value='yes'/>Subscribe?";
  4. if(isset($_POST['subscribe'])){
  5. if($_POST['subscribe'] == $value){
  6. $subscribed = true;
  7. }else{
  8. $subscribed = false;
  9. print 'Invalid checkbox value submitted.';
  10. }
  11. }else{$subscribed = false;}
  12. if($subscribed){
  13. print 'You Are Subscribed.';}else{print 'You Are not Subscribed.';}
Success #stdin #stdout 0.02s 25924KB
stdin
1
2
10
42
11
stdout
<input type='checkbox' name='subscribe' value='yes'/>Subscribe?You Are not Subscribed.