Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]blad w skrypcie na srednia
Amarant90
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 21.09.2013

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


  1. <?php
  2. if (!$T1 && !$T2&&.......)
  3. {
  4.  
  5. print '<form method="POST" >';
  6. print '<table border="1" width="100%">';
  7. print '<tr>';
  8. print '<td colspan="2" bgcolor="#d65d55">';
  9. print '<p align="center"><font face="Verdana">KALKULATOR OCENY</font></td>';
  10. print '</tr>';
  11. print '<tr>';
  12. print '<td width="48%"><font face="Verdana" size="2">J. polski</font></td>';
  13. print '<td width="50%"><input type="text" name="T1" size="37"></td>';
  14. print '</tr>';
  15. print '<tr>';
  16. print '<td width="48%"><font face="Verdana" size="2">J. angielski</font></td>';
  17. print '<td width="50%"><input type="text" name="T2" size="37"></td>';
  18. print '</tr>';
  19. print '<tr>';
  20. print '<td width="48%" ><font face="Verdana" size="2">Historia</font></td>';
  21. print '<td width="50%" height="29"><input type="text" name="T3" size="37"></td>';
  22. print '</tr>';
  23. print '<tr>';
  24. print '<td width="48%"><font face="Verdana" size="2">Matematyka</font></td>';
  25. print '<td width="50%"><input type="text" name="T4" size="37"></td>';
  26. print '</tr>';
  27. print '<tr>';
  28. print '<td width="48%"><font face="Verdana" size="2">Geografia</font></td>';
  29. print '<td width="50%"><input type="text" name="T5" size="37"></td>';
  30. print '</tr>';
  31. print '<tr>';
  32. print '<td width="48%" ><font face="Verdana" size="2">Biologia</font></td>';
  33. print '<td width="50%" height="24"><input type="text" name="T6" size="37"></td>';
  34. print '</tr>';
  35. print '<tr>';
  36. print '<td width="48%"><font face="Verdana" size="2">Chemia</font></td>';
  37. print '<td width="50%" height="6"><input type="text" name="T7" size="37"></td>';
  38. print '</tr>';
  39. print '<tr>';
  40. print '<td width="48%" height="2"><font face="Verdana" size="2">Fizyka z
  41. astronomią</font></td>';
  42. print '<td width="50%" height="2"><input type="text" name="T8" size="37"></td>';
  43. print '</tr>';
  44. print '<tr>';
  45. print '<td width="48%" height="5"><font face="Verdana" size="2">Technologia
  46. informacyjna</font></td>';
  47. print '<td width="50%" height="5"><input type="text" name="T9" size="37"></td>';
  48. print '</tr>';
  49. print '<tr>';
  50. print '<td width="48%" height="23"><font face="Verdana" size="2">Wychowanie
  51. fizyczne</font></td>';
  52. print '<td width="50%" height="23"><input type="text" name="T10" size="37"></td>';
  53. print '</tr>';
  54. print '</table>';
  55. echo '<p align="center"><input type="submit" value="Oblicz" name="licz"></p>';
  56. echo '</form>';
  57. }
  58. else
  59. {
  60. $suma=$T1+$T2+$T3+$T4+$T5+$T6+$T7+$T8+$T9+$T10;
  61. $srednia=$suma/10;
  62. echo "Średnia wynosi $srednia";
  63. ?>


Mam taki kodzik, jednak nie wiem czemu nie chce zadziałać

Ten post edytował Amarant90 21.09.2013, 15:59:12
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Amarant90
post
Post #2





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 21.09.2013

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


Działa, był jeszcze jeden błąd, który sama wyłapałam.

print 'Średnia wynosi $srednia';

zmieniłam na print 'Średnia wynosi:' .$srednia;

Zajęcia ze "Specjalizacji informatycznych" w technikum.

Teraz kolejne pytanie. Czy dałoby ten kod php wmontować w ten o to kodzik

  1. <title> Srednia arytmetyczna z ocen</title>
  2. </head>
  3. <td>
  4. <div style="background-color:#ece0d2;
  5. width: 800px;
  6. box-shadow: 0px 0px 10px;
  7. border-top: 10px #57003a ridge;
  8. border-bottom: 10px #57003a groove;
  9. border-radius: 30px;
  10. -moz-border-radius: 30px;
  11. -htm-border-radius: 30px;
  12. -webkit-border-radius: 30px; ">
  13.  
  14. <div class="DAF1">
  15. <div style="font-family:Playball;font-size: 40px; color: d65d55; position: relative;">Srednia arytmetyczna</div>
  16. <div style="font-family: century gothic;
  17. font-size: 11px;
  18. border-bottom: 1px solid f4bc64;
  19. width: 550px;">KALKULATOR LICZACY SREDNIA Z OCEN</div>
  20. <br><img src="http://i1074.photobucket.com/albums/w417/UNLlife/computer.gif"
  21. border-radius: 25px 25px 0px 0px;
  22. -moz-border-radius: 25px 25px 0px 0px;
  23. -htm-border-radius: 25px 25px 0px 0px;
  24. -webkit-border-radius: 25px 25px 0px 0px; opacity:0.5;">
  25.  
  26.  
  27. <div style="font-family:Playball;
  28. font-size: 35px;
  29. color: #d65d55;text-align: center;
  30. margin-top: -40px;
  31. font-size:52px;">Fromularz</div>
  32.  
  33. <div style="abc
  34. border: 1px solid f1e2cf;
  35. width: 550px;
  36. background-color:f7ecdc;
  37. font-family: century gothic;
  38. font-size: 11px;
  39. text-align: center;
  40. padding: 5px;"</div>
  41.  
  42.  
  43. [tutaj forumlarz liczacy srednią]
  44.  
  45. </body>
  46.  
  47.  
  48. </center>
  49.  
  50.  
  51. </body>
  52. </html>


(IMG:http://img822.imageshack.us/img822/8782/bpjt.jpg)
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: 18.10.2025 - 11:46