Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Grafika w PHP
Tsiru
post
Post #1





Grupa: Zarejestrowani
Postów: 213
Pomógł: 0
Dołączył: 7.01.2005
Skąd: Nigdzie

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


Chciałen zrobić sonde, która by prezentowała wyniki w słupkach.
przygotowałem małe 3 pliki, prawy bok, lewy bok i środek (tu są).
Nieumiem bawić się grafiką w php, więc może powiecie mi, jak zrobić, żeby "sklejało" mi te 3 pliki, rozciągając środkowy o wartość danej zmiennej ?
Dzięki z góry.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Tsiru
post
Post #2





Grupa: Zarejestrowani
Postów: 213
Pomógł: 0
Dołączył: 7.01.2005
Skąd: Nigdzie

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


Wielkie dzięki HWAO
--------------------------------------------------------------------------------------
edit:
Wymodziłem coś takiego, i na localu mi działa a na serwerku nie :-/.
Poprostu niedodaje głosów :-(
  1. <pre><?php
  2. $gra=$_REQUEST['najlepsza_gra'];
  3. if($gra==&#092;"sh1\"||$gra==\"sh2\"||$gra==\"sh3\"||$gra==\"sh4\")
  4. $plik=fgets(fopen(&#092;"data/sonda/$gra.txt\",\"r\" ),250);
  5. if(!($_COOKIE['sonda']==&#092;"blokuj_sonde\"))
  6. {
  7. if($gra=='sh1')
  8. {
  9. $plik++;
  10. echo'Twój głos został dodany.';
  11. setcookie('sonda','blokuj_sonde',time()+1);
  12. }
  13. else
  14. {
  15. if($gra=='sh2')
  16. {
  17. $plik++;
  18. echo'Twój głos został dodany.';
  19. setcookie('sonda','blokuj_sonde',time()+1);
  20. }
  21. else
  22. {
  23. if($gra=='sh3')
  24. {
  25. $plik++;
  26. echo'Twój głos został dodany.';
  27. setcookie('sonda','blokuj_sonde',time()+1);
  28. }
  29. else
  30. {
  31. if($gra=='sh4')
  32. {
  33. $plik++;
  34. echo'Twój głos został dodany.';
  35. setcookie('sonda','blokuj_sonde',time()+1);
  36. }
  37. else 
  38. echo'Najlepszy Silent Hill według was to:<br>';
  39. }
  40. }
  41. }
  42. if($gra==&#092;"sh1\"||$gra==\"sh2\"||$gra==\"sh3\"||$gra==\"sh4\")
  43. {
  44. fwrite(fopen(&#092;"data/sonda/$gra.txt\",\"w\"),$plik,250);
  45. fclose(fopen(&#092;"data/sonda/$gra.txt\",\"w\"));
  46. }
  47. }
  48. else
  49. {
  50. echo'już oddałeś głos';
  51. }
  52. $sh1=fgets(fopen(&#092;"data/sonda/sh1.txt\",\"r\" ),250);
  53. $sh2=fgets(fopen(&#092;"data/sonda/sh2.txt\",\"r\" ),250);
  54. $sh3=fgets(fopen(&#092;"data/sonda/sh3.txt\",\"r\" ),250);
  55. $sh4=fgets(fopen(&#092;"data/sonda/sh4.txt\",\"r\" ),250);
  56. ';
  57. echo&#092;"<b>Silent Hill 1</b> <img src=\"rc.gif\" alt=\"Statystyka\" border=0 height=12 width=\"$sh1\" hspace=0 vspace=0> $sh1
  58. &#092;";
  59. echo&#092;"<b>Silent Hill 2</b> <img src=\"rc.gif\" alt=\"Statystyka\" border=0 height=12 width=\"$sh2\" hspace=0 vspace=0> $sh2
  60. &#092;";
  61. echo&#092;"<b>Silent Hill 3</b> <img src=\"rc.gif\" alt=\"Statystyka\" border=0 height=12 width=\"$sh3\" hspace=0 vspace=0> $sh3
  62. &#092;";
  63. echo&#092;"<b>Silent Hill 4</b> <img src=\"rc.gif\" alt=\"Statystyka\" border=0 height=12 width=\"$sh4\" hspace=0 vspace=0> $sh4
  64. &#092;";
  65. fclose(fopen(&#092;"data/sonda/sh1.txt\",\"r\" ));
  66. fclose(fopen(&#092;"data/sonda/sh2.txt\",\"r\" ));
  67. fclose(fopen(&#092;"data/sonda/sh3.txt\",\"r\" ));
  68. fclose(fopen(&#092;"data/sonda/sh4.txt\",\"r\" ));
  69. ?></pre>


Ten post edytował Tsiru 5.03.2005, 18:01:56
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: 23.12.2025 - 06:29