Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Kalkulator w php
djjbenus
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 22.05.2010

Ostrzeżenie: (0%)
-----


Witam,

pisze kalkulator w php za pomocą formularza.

  1. <html>
  2. <head>
  3. <title>Kalkulator
  4. </title>
  5. </head>
  6. <body>
  7. <div id="">
  8. <form action="kalkulator.php" method="POST">
  9. <input type="text" name="model" title="wynik" size="12" value="0"/> <br /><br />
  10. <input class="submit" type="submit" name="submit" value="1" />
  11. <input class="submit" type="submit" name="submit" value="2" />
  12. <input class="submit" type="submit" name="submit" value="3" />
  13. <input class="submit" type="submit" name="submit" value="+" /> <br />
  14. <input class="submit" type="submit" name="submit" value="4" />
  15. <input class="submit" type="submit" name="submit" value="5" />
  16. <input class="submit" type="submit" name="submit" value="6" />
  17. <input class="submit" type="submit" name="submit" value="-" /> <br />
  18. <input class="submit" type="submit" name="submit" value="7" />
  19. <input class="submit" type="submit" name="submit" value="8" />
  20. <input class="submit" type="submit" name="submit" value="9" />
  21. <input class="submit" type="submit" name="submit" value="*" /> <br />
  22. <input class="submit" type="submit" name="submit" value=" , " />
  23. <input class="submit" type="submit" name="submit" value="0" />
  24. <input class="submit" type="submit" name="submit" value="=" />
  25. <input class="submit" type="submit" name="submit" value="/" />
  26. </form>
  27. </div>
  28. </body>
  29. </html>


Teraz mój problem. Otóż jak przekazać wartość przycisku do pola tekstowego na górze zarazem wykonując działania?

Z góry dzięki.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
djjbenus
post
Post #2





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 22.05.2010

Ostrzeżenie: (0%)
-----


No mi chodzi o to aby ten formularz działał jak prosty kalkulator. Tylko nie bardzo wiem w jaki sposób później wykonywać działania i przypisania do tej zmiennej. "Chcesz zrobić coś takiego jak kalkulator windows w PHP, to musisz albo zczytywać każdy wciśnięty przycisk w php" otóż to (IMG:style_emoticons/default/smile.gif)

Ten post edytował djjbenus 12.07.2012, 11:39:58
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 17.09.2025 - 23:37