Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <title>05.Boolean Variable</title>
- <meta charset="utf8"/>
- </head>
- <body>
- <h2>Choose your sex:</h2>
- <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="get">
- <select name="sex">
- <option value="male">male</option>
- <option value="female">female</option>
- </select>
- <input type="submit" name="send" value="OK">
- </form>
- <?php
- if(isset($_GET['send'])){
- $sex = $_GET['sex'];
- $question = "Are you female?";
- if($sex=='male'){
- echo "$question - False.You are $sex.<br/>";
- }
- else{
- echo "$question - True.You are $sex.<br/>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement