Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. class material {
  5. public $nazwa;
  6. public $waga;
  7. public $wymiar;
  8. public $kolor;
  9. public $dlugosc;
  10. public $szerokosc;
  11.  
  12.  
  13. public function construct($nazwa, $waga, $wymiar, $kolor, $dlugosc, $szerokosc)
  14. {
  15. $this->nazwa = $nazwa;
  16. $this->waga = $waga;
  17. $this->wymiar = $wymiar;
  18. $this->kolor = $kolor;
  19. $this->dlugosc = $dlugosc;
  20. $this->szerokosc = $szerkosc;
  21.  
  22. }
  23.  
  24.  
  25.  
  26. public function wyswietl()
  27. {
  28. echo'
  29. <table>
  30. <tr><td>nazwa: </td><td> '.$this->nazwa.'</td></tr>
  31. <tr><td>waga: </td><td> '.$this->waga.'</td></tr>
  32. <tr><td>wymiar: </td><td> '.$this->wymiar.'</td></tr>
  33. <tr><td>kolor: </td><td> '.$this->kolor.'</td></tr>
  34. <tr><td>dlugosc: </td><td> '.$this->dlugosc.'</td></tr>
  35. <tr><td>szerokosc: </td><td> '.$this->szerokosc.'</td></tr>
  36.  
  37. </table>';
  38. }
  39.  
  40. public function wprowadz($nazwa, $waga, $wymiar, $kolor, $dlugosc, $szerokosc)
  41. {
  42. $this->nazwa = $nazwa;
  43. $this->waga = $waga;
  44. $this->wymiar = $wymiar;
  45. $this->kolor = $kolor;
  46. $this->dlugosc = $dlugosc;
  47. $this->szerokosc = $szerkosc;
  48. }
  49. public function otworzplik(){
  50.  
  51. }
  52. }
  53.  
  54. $element= new material();
  55. $element->wyswietl();
  56.  
  57. ?>
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. <!DOCTYPE html>
  65.  
  66.  
  67. <head>
  68. <title>Materialy</title>
  69. </head>
  70.  
  71. <body>
  72. <form action="skrypt1.php" method="get">
  73. nazwa: <input type="text" size"20" maxlength="20" name="nazwa"></br>
  74. waga: <input type="text" size"20" maxlength="20" name="waga"></br>
  75. wymiar: <input type="text" size"20" maxlength="20" name="wymiar"></br>
  76. kolor: <input type="text" size"20" maxlength="20" name="kolor"></br>
  77. dlugosc: <input type="text" size"20" maxlength="20" name="dlugosc"></br>
  78. szerokosc: <input type="text" size"20" maxlength="20" name="szerokosc"></br>
  79. <input type="submit" value="Wyslij">
  80. </body>
  81.  
  82.  
  83.  
  84. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement