Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z plikiem php w XAMPP
Forum PHP.pl > Forum > PHP
karolunited
Wiec mam plik nazwany "kalkulator2.php" ktory jest w folderze "htdocs" bo uzywam programu xampp.
Kiedy robie localhost to mi wyswietla moj kalkulator ktorego zrobilem, a jak naciskam przycisk typu "C" lub "1" to mi wyswietla " Nie znaleziono obiektu!

Nie znaleziono żądanego URLa na tym serwerze. Jeśli wpisałeś URLa ręcznie, sprawdź, czy nie się nie pomyliłeś. "

Oto kod jezeli jest potrzebny:

  1. <?php
  2.  
  3.  
  4. if (isset($_GET['btn']))
  5. {
  6. switch ($_GET['btn']) {
  7. case 1:
  8. $myText1 = myAction($_GET['btn']);
  9. break;
  10.  
  11. case 2:
  12. $myText1 = "dwa";
  13. break;
  14. default:
  15. $myText1 = "inna wartosc";
  16.  
  17. }
  18.  
  19. }
  20.  
  21. else {
  22. $myText1 =0;
  23.  
  24. }
  25.  
  26.  
  27. function myAction($myValue){
  28.  
  29. return $myValue;
  30. }
  31.  
  32.  
  33.  
  34. ?>
  35.  
  36. <center>
  37. <div style="position: absolute; width: 500px; margin-left: 50%; left: -250px;">
  38. <form action="Kalkulator.php" method="get">
  39.  
  40. Kalkulator </br> </br></br>
  41.  
  42.  
  43. <input type="text" name="Text1" value="<?php echo $myText1; ?>" style=" width: 210px; float: left; margin-left: 140px;" />
  44. </br> </br>
  45. <button type="submit" name="btn" value="C" style="width: 210px;"> C </button>
  46. </br>
  47. <button type="submit" name="btn" value="1" style="width:50px;" > 1 </button>
  48. <button type="submit" name="btn" value="2" style="width:50px;" style="margin-left:10px"; > 2 </button>
  49. <button type="submit" name="btn" value="3" style="width:50px;" style="margin-left:10px"; > 3 </button>
  50. <button type="submit" name="btn" value="dodawanie" style="width:50px;" style="margin-left:10px"; > + </button>
  51. </br>
  52. <button type="submit" name="btn" value="4" style="width:50px;" style="margin:10px 0px 0px 10px;"; > 4 </button>
  53. <button type="submit" name="btn" value="5" style="width:50px;" style="margin-left:10px"; > 5 </button>
  54. <button type="submit" name="btn" value="6" style="width:50px;" style="margin-left:10px"; > 6 </button>
  55. <button type="submit" name="btn" value="odejmowanie" style="width:50px;" style="margin-left:10px"; > - </button>
  56. </br>
  57. <button type="submit" name="btn" value="7" style="width:50px;" style="margin-left:10px"; > 7 </button>
  58. <button type="submit" name="btn" value="8" style="width:50px;" style="margin-left:10px"; > 8 </button>
  59. <button type="submit" name="btn" value="9" style="width:50px;" style="margin-left:10px"; > 9 </button>
  60. <button type="submit" name="btn" value="mnozenie" style="width:50px;" style="margin-left:10px"; > * </button>
  61. </br>
  62. <button type="submit" name="btn" value="przecinek" style="width:50px;" style="margin-left:10px"; > , </button>
  63. <button type="submit" name="btn" value="0" style="width:50px;" style="margin-left:10px"; > 0 </button>
  64. <button type="submit" name="btn" value="rowna" style="width:50px;" style="margin-left:10px"; > = </button>
  65. <button type="submit" name="btn" value="dzielenie" style="width:50px;" style="margin-left:10px"; > / </button>
  66. </form>
  67. </div>
  68. </center>
  69.  
Kuba707
Kod
<form action="Kalkulator.php" method="get">

Masz ten plik 'Kalkulator.php' w tym katalogu?
lukaskolista
zobacz sobie adres na ktory zapytanie zostalo wyslane (w pasku przegladarki u gory) i bedziesz wiedzial co jest nie tak
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.