Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <title>Choinka</title>
  5. <style type="text/css">
  6. .czarne {
  7. background-color: black;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <form method="POST" action="?w=rysuj">
  13. <input type="number" name="wier" placeholder="3" required />
  14. <input type="number" name="kolum" placeholder="3" required />
  15. <input type="submit" value="Rysuj" />
  16. </form>
  17. <center>
  18.  
  19. <?php
  20. if(isset($_GET['w']) && !empty($_GET['w'])) {
  21. $w = $_GET['w'];
  22. if($w == 'rysuj'){
  23. $wiersze = $_POST['wier'];
  24. $kolu = $_POST['kolum'];
  25. echo'<div style="color:green;">';
  26. for($x=1; $x<=$kolu; $x++){
  27. for($y=1; $y<=$wiersze; $y++){
  28. for($z=1; $z<=$y; $z++){
  29. echo'#';
  30. }
  31. echo'</br>';
  32. }
  33. $z=$z-3;
  34. }
  35. }
  36. echo '</div><div style="color:brown;"><b>
  37. | |</b>
  38. </div>';
  39. }
  40. ?>
  41. <form method="POST" action="?b=buduj">
  42. <input type="number" name="wys" placeholder="3" required />
  43. <input type="submit" value="Buduj" />
  44. <?php
  45. if(isset($_GET['b']) && !empty($_GET['b'])){
  46. $b = $_GET['b'];
  47. If($b == 'buduj'){
  48. echo '<table width="100%" border="1" color="black">';
  49. $t = $_POST['wys'];
  50. for($m=1; $m<=$t; $m++){
  51. echo'<tr width="100%" height="100%"><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td>
  52. <td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td><td class="czarne" height="42px"></td><td></td>';
  53.  
  54.  
  55. }
  56.  
  57. }
  58. }
  59.  
  60. ?>
  61. </form>
  62. </center>
  63. </body>
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement