Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> grafika, tak tak, dział dobry.. ;)
marcinvx
post
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 11.02.2011

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


  1. <?php
  2. // Create a 300x100 image
  3. $im = imagecreatetruecolor(300, 100);
  4. $red = imagecolorallocate($im, 0xFF, 0x00, 0x00);
  5. $black = imagecolorallocate($im, 0x00, 0x00, 0x00);
  6.  
  7. // Make the background red
  8. imagefilledrectangle($im, 0, 0, 299, 99, $red);
  9.  
  10. // Path to our ttf font file
  11. $font_file = './arial.ttf';
  12.  
  13. // Draw the text 'PHP Manual' using font size 13
  14. imagefttext($im, 13, 0, 105, 55, $black, $font_file, 'PHP Manual');
  15.  
  16. // Output image to the browser
  17. header('Content-Type: image/png');
  18.  
  19. imagepng($im);
  20. imagedestroy($im);
  21. ?>

Jak zrobić że zamiast czarnego tła jest obrazek ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tehaha
post
Post #2





Grupa: Zarejestrowani
Postów: 1 748
Pomógł: 388
Dołączył: 21.08.2009
Skąd: Gdynia

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


przy pomocy mod_rewrite w .htaccess dajesz:
  1. RewriteEngine on
  2. RewriteRule ^([a-zA-Z]*).gif image.php?name=$1 [L]

następnie w skrypcie odbierasz nazwę zmienną $_GET['name']
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: 4.10.2025 - 21:42