<?php { switch ($_GET['btn']) { case 1: $myText1 = myAction($_GET['btn']); break; case 2: $myText1 = "dwa"; break; default: $myText1 = "inna wartosc"; } } else { $myText1 =0; } function myAction($myValue){ return $myValue; } ?> <center> <div style="position: absolute; width: 500px; margin-left: 50%; left: -250px;"> <form action="Kalkulator.php" method="get"> Kalkulator </br> </br></br> <input type="text" name="Text1" value="<?php echo $myText1; ?>" style=" width: 210px; float: left; margin-left: 140px;" /> </br> </br> <button type="submit" name="btn" value="C" style="width: 210px;"> C </button> </br> <button type="submit" name="btn" value="1" style="width:50px;" > 1 </button> <button type="submit" name="btn" value="2" style="width:50px;" style="margin-left:10px"; > 2 </button> <button type="submit" name="btn" value="3" style="width:50px;" style="margin-left:10px"; > 3 </button> <button type="submit" name="btn" value="dodawanie" style="width:50px;" style="margin-left:10px"; > + </button> </br> <button type="submit" name="btn" value="4" style="width:50px;" style="margin:10px 0px 0px 10px;"; > 4 </button> <button type="submit" name="btn" value="5" style="width:50px;" style="margin-left:10px"; > 5 </button> <button type="submit" name="btn" value="6" style="width:50px;" style="margin-left:10px"; > 6 </button> <button type="submit" name="btn" value="odejmowanie" style="width:50px;" style="margin-left:10px"; > - </button> </br> <button type="submit" name="btn" value="7" style="width:50px;" style="margin-left:10px"; > 7 </button> <button type="submit" name="btn" value="8" style="width:50px;" style="margin-left:10px"; > 8 </button> <button type="submit" name="btn" value="9" style="width:50px;" style="margin-left:10px"; > 9 </button> <button type="submit" name="btn" value="mnozenie" style="width:50px;" style="margin-left:10px"; > * </button> </br> <button type="submit" name="btn" value="przecinek" style="width:50px;" style="margin-left:10px"; > , </button> <button type="submit" name="btn" value="0" style="width:50px;" style="margin-left:10px"; > 0 </button> <button type="submit" name="btn" value="rowna" style="width:50px;" style="margin-left:10px"; > = </button> <button type="submit" name="btn" value="dzielenie" style="width:50px;" style="margin-left:10px"; > / </button> </form> </div> </center>
Wiec zrobilem juz kalkulator (ktory narazie nie liczy

- Jak wciskam "C" to mi wyswietli w okienku "0"
- I zeby jak przyciskam po koleji liczby typu "123456" to zeby w okienku mi to samo napisalo.
Dziekuje za pomoc, jestem nowy na forum wiec prosze o wyrozumialosc :*