Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][GD] Nie tworzy grafiki
Freequ
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 10.03.2008

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


Cześć.
Mam na serwerze GD w wersji 2.0.35, wszystkie formaty supportowane.
Mój kod wygląda tak:
  1. <?php
  2. $im = imagecreatefromgif("http://mindworxadvisory.com/images/offer-img.gif");
  3. header('Content-Type: image/gif');
  4. ?>

Mimo tego nie tworzy obrazka. Co może być tego przyczyną?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
-lukasamd-
post
Post #2





Goście







No przecież na wyjście go nie podałeś.


  1. $im = imagecreatefromgif("http://mindworxadvisory.com/images/offer-img.gif");
  2. header('Content-Type: image/gif');
  3. imagegif($im);
  4. imagedestroy($im);
Go to the top of the page
+Quote Post
wookieb
post
Post #3





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




A na jakiej podstawie twierdziłeś, że twój kod może zadziałać?
Go to the top of the page
+Quote Post
Freequ
post
Post #4





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 10.03.2008

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


lukas, widzisz do czego pośpiech prowadzi. Dzieki (IMG:style_emoticons/default/smile.gif)
  1. <form action="" method="post">
  2. Podaj nazwe postaci:<br>
  3. <input type="text" name="nazwa"><br>
  4. Podaj poziom postaci:<br>
  5. <input type="text" name="lv"><br>
  6. Podaj serwer:
  7. <input type="text" name="srv"><br>
  8. <input type="hidden" name="slij" value="1">
  9. <input type="submit" value="Wyslij">
  10. </form>
  11. <?php
  12. if($_POST["slij"]==1){
  13. $im = imagecreatefrompng('840_metin2.png');
  14. $textcolor = imagecolorallocate($im, 0, 0, 255);
  15. imagestring($im, 5, 0, 0, 'Hello world!', $textcolor);
  16. header('Content-type: image/png');
  17.  
  18. imagepng($im);
  19. imagedestroy($im);
  20. }
  21. ?>

Nie generuje "Hello World", jestem laikiem kompletnym, mimo tego, że w tym siedze troche ;f

Ten post edytował Freequ 31.07.2010, 10:09:48
Go to the top of the page
+Quote Post
-lukasamd-
post
Post #5





Goście







Wywala error?
Jeżeli tak, to prawidłowo - nie możesz najpierw wysyłać tekstu a potem do tego wysyłać kolejny nagłówek określający typ zawartości.

  1. <?php
  2. if(isset($_POST["slij" ]) AND ($_POST["slij" ] == 1))
  3. {
  4. $im = imagecreatefrompng('aaa.png');
  5. $textcolor = imagecolorallocate($im, 0, 0, 255);
  6. imagestring($im, 5, 0, 0, 'Hello world!', $textcolor);
  7. header('Content-type: image/png');
  8.  
  9. imagepng($im);
  10. imagedestroy($im);
  11. exit();
  12. }
  13. else
  14. {
  15. ?>
  16. <form action="" method="post">
  17. Podaj nazwe postaci:<br>
  18. <input type="text" name="nazwa"><br>
  19.  
  20. Podaj poziom postaci:<br>
  21. <input type="text" name="lv"><br>
  22.  
  23. Podaj serwer:
  24. <input type="text" name="srv"><br>
  25.  
  26. <input type="hidden" name="slij" value="1">
  27. <input type="submit" value="Wyslij">
  28. </form>
  29. <?php
  30. }
  31. ?>
Go to the top of the page
+Quote Post

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: 22.08.2025 - 17:51