No to w takim razie jak to skrócić. Może ktoś mógłby podać całość?
  1. <?
  2. if ($snd1==&#092;"1\")
  3. {
  4. $file11=fopen(&#092;"snd/1.txt\", \"r\");
  5. $wassup11=fgets($file11);
  6. fclose($file11);
  7. $file21=fopen(&#092;"snd/1.txt\", \"w\");
  8. fwrite($file21, $wassup11+1);
  9. fclose($file21);
  10. }
  11. if ($snd1==&#092;"2\")
  12. {
  13. $file12=fopen(&#092;"snd/2.txt\", \"r\");
  14. $wassup12=fgets($file12);
  15. fclose($file12);
  16. $file22=fopen(&#092;"snd/2.txt\", \"w\");
  17. fwrite($file22, $wassup12+1);
  18. fclose($file22);
  19. }
  20. if ($snd1==&#092;"3\")
  21. {
  22. $file13=fopen(&#092;"snd/3.txt\", \"r\");
  23. $wassup13=fgets($file13);
  24. fclose($file13);
  25. $file23=fopen(&#092;"snd/3.txt\", \"w\");
  26. fwrite($file23, $wassup13+1);
  27. fclose($file23);
  28. }
  29. if ($snd1==&#092;"4\")
  30. {
  31. $file14=fopen(&#092;"snd/4.txt\", \"r\");
  32. $wassup14=fgets($file14);
  33. fclose($file14);
  34. $file24=fopen(&#092;"snd/4.txt\", \"w\");
  35. fwrite($file24, $wassup14+1);
  36. fclose($file24);
  37. }
  38.  
  39. $file31=fopen(&#092;"snd/1.txt\", \"r\");
  40. $wassup21=fgets($file31);
  41. fclose($file31);
  42. $file32=fopen(&#092;"snd/2.txt\", \"r\");
  43. $wassup22=fgets($file32);
  44. fclose($file32);
  45. $file33=fopen(&#092;"snd/3.txt\", \"r\");
  46. $wassup23=fgets($file33);
  47. fclose($file33);
  48. $file34=fopen(&#092;"snd/4.txt\", \"r\");
  49. $wassup24=fgets($file34);
  50. fclose($file34);
  51.  
  52. $allvotes=$wassup21+$wassup22+$wassup23+$wassup24;
  53.  
  54. if ($wassup21==0)
  55. {
  56. $srednia1=0;
  57. }
  58. if ($wassup22==0)
  59. {
  60. $srednia2=0;
  61. }
  62. if ($wassup23==0)
  63. {
  64. $srednia3=0;
  65. }
  66. if ($wassup24==0)
  67. {
  68. $srednia4=0;
  69. }
  70. if ($wassup21>0)
  71. {
  72. $srednia1=($wassup21/$allvotes)*100;
  73. }
  74. if ($wassup22>0)
  75. {
  76. $srednia2=($wassup22/$allvotes)*100;
  77. }
  78. if ($wassup23>0)
  79. {
  80. $srednia3=($wassup23/$allvotes)*100;
  81. }
  82. if ($wassup24>0)
  83. {
  84. $srednia4=($wassup24/$allvotes)*100;
  85. }
  86. $taktak1=&#092;"$srednia1% ($wassup21)\";
  87. $taktak2=&#092;"$srednia2% ($wassup22)\";
  88. $taktak3=&#092;"$srednia3% ($wassup23)\";
  89. $taktak4=&#092;"$srednia4% ($wassup24)\";
  90. echo(&#092;"Oto wyniki:<P>\");
  91. echo(&#092;"Download:<BR><img src=1.jpg width=$srednia1 height=8>$taktak1<br>\");
  92. echo(&#092;"Chat:<BR><img src=1.jpg width=$srednia2 height=8>$taktak2<br>\");
  93. echo(&#092;"Instrukcje:<BR><img src=1.jpg width=$srednia3 height=8>$taktak3<br>\");
  94. echo(&#092;"Linki:<BR><img src=1.jpg width=$srednia4 height=8>$taktak4<P>\");
  95. echo(&#092;"<div align=center><a href=index.php>Powrót</a></div>\");
  96. ?>