Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Grafika w PHP
Tsiru
post 5.03.2005, 15:38:27
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
ARJ
post 5.03.2005, 15:42:10
Post #2





Grupa: Zarejestrowani
Postów: 453
Pomógł: 22
Dołączył: 20.09.2004
Skąd: Kraków - NH -

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


to raczej html
  1. <img src="1.gif" border="0" alt=""><img src="c.gif" width="<?echo $sonda;?>" border="0" alt=""><img src="r.gif" border="0" alt="">


--------------------
Warsztat: Windows 7 Pro 64bit | Apache 2.2 | PHP 5.2 | MySQL 5.0 | PHPmyadmin 2.6.4
Go to the top of the page
+Quote Post
Tsiru
post 5.03.2005, 15:43:13
Post #3





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

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


myślałem nad tym,ale nawet jak ustawie odstępy na zero to i tak pliki niesą koło siebie
Go to the top of the page
+Quote Post
hwao
post 5.03.2005, 15:51:41
Post #4


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




bardzooooo stara ale moze cos z niej wyciagniesz
http://amnesty.scene.pl/~szacool/hwao/php/sonda.zip
Go to the top of the page
+Quote Post
Tsiru
post 5.03.2005, 16:05:39
Post #5





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

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 12.06.2025 - 12:23