Advertisement
nikolaysimeonov

05.Boolean Variable

Jun 12th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4.     <title>05.Boolean Variable</title>
  5.         <meta charset="utf8"/>
  6. </head>
  7. <body>
  8. <h2>Choose your sex:</h2>
  9. <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="get">
  10.     <select name="sex">
  11.         <option value="male">male</option>
  12.         <option value="female">female</option>
  13.     </select>
  14.     <input type="submit" name="send" value="OK">
  15. </form>
  16. <?php
  17. if(isset($_GET['send'])){
  18. $sex = $_GET['sex'];
  19. $question = "Are you female?";
  20.     if($sex=='male'){
  21.         echo "$question - False.You are $sex.<br/>";
  22.     }
  23.     else{
  24.         echo "$question - True.You are $sex.<br/>";
  25.     }
  26. }
  27. ?>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement