Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="utf-8">
- <title>dEn Cliqulatoz</title>
- <h1>THe KLaCULATIOR</h1>
- </head>
- <body bgcolor="#FF00FF" background="http://bestanimations.com/Animals/Birds/Parrots/animated-parrot-gif-2.gif">
- <form action="" method="Post">
- <p>z1 Value:<br/>
- <input type="text" name="z1" value="<?PHP if(!empty($_POST['z1']))echo $_POST['z1']?>"><br><br>
- <p>z2 Value:<br/>
- <input type="text" name="z2" value="<?PHP if(!empty($_POST['z2']))echo $_POST['z2']?>">
- <br><br>
- <button type="submit" name="group1" id="add" value="add">+</button>
- <button type="submit" name="group1" id="subtract" value="subtract">-</button>
- <button type="submit" name="group1" id="times" value="times">*</button>
- <button type="submit" name="group1" id="divide" value="divide">/</button>
- <p>
- <button type="submit" name="group1" id="force" value="force">^</button>
- <button type="submit" name="group1" id="sqrt" value="sqrt">²√</button>
- <!-- <button type="submit" name="group1" id="xrt" value="divide">/</button>
- <button type="submit" name="group1" id="divide" value="divide">/</button> -->
- </form>
- <p>
- answer:
- <p>
- <h1>
- <?php
- /*
- if (!empty($_POST['z1'])){
- $z1 = $_POST['z1'];
- $z2 = $_POST['z2'];
- else if($_POST['group1'] == 'sqrt') {
- echo sqrt($z1);
- }
- else if(!empty($_POST['z1']) && !empty($_POST['z2'])){
- $z1 = $_POST['z1'];
- $z2 = $_POST['z2'];
- if($_POST['group1'] == 'add') {
- echo $z1 + $z2;
- }
- else if($_POST['group1'] == 'subtract') {
- echo $z1 - $z2;
- }
- else if($_POST['group1'] == 'times') {
- echo $z1 * $z2;
- }
- else if($_POST['group1'] == 'divide') {
- echo $z1 / $z2;
- }
- else if($_POST['group1'] == 'force') {
- echo pow($z1 , $z2);
- }
- }
- }
- else{}
- */
- if(!empty($_POST['z1']) && !empty($_POST['z2'])){
- switch($_POST["group1"]){
- case "add":
- echo ($z1 + $z2);
- break;
- case "subtract":
- echo ($z1 - $z2);
- break;
- case "times":
- echo ($z1 * $z2);
- break;
- case "divide":
- echo ($z1 / $z2);
- break;
- case "force":
- echo (pow($z1, $z2));
- break;
- case "sqrt":
- echo (sqrt($z1));
- break;
- // case(){$z1 $z2}
- // case(){$z1 $z2}
- }}
- else{}
- ?>
- </h1>
- </form>
- </body>
- </html>
RAW Paste Data