Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][GD] błedy w tokenie
XP'ek
post
Post #1





Grupa: Zarejestrowani
Postów: 263
Pomógł: 9
Dołączył: 3.05.2009
Skąd: Wroc

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


Witam

Czemu jk includuje tokena do innego skryptu aby go wyswietlic wywala mi jakies krzaki?


Kod
<?php

$symbols = "abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";



$width  = 100;
$height = 40;

$pic = ImageCreate($width,$height);


$white  = ImageColorAllocate($pic,255,255,255);
$silver = ImageColorAllocate($pic,210,210,210);
$gray   = ImageColorAllocate($pic,150,150,150);

ImageFill($pic,0,0,$white);


$black  = ImageColorAllocate($pic,0,0,0);
$red    = ImageColorAllocate($pic,255,0,0);
$blue   = ImageColorAllocate($pic,0,0,255);
$green  = ImageColorAllocate($pic,10,255,10);
$yellow = ImageColorAllocate($pic,255,255,50);
$orange = ImageColorAllocate($pic,255,150,0);

$colors = Array($black,$red,$blue,$green,$yellow,$orange);


ImageRecTangle($pic,0,0,$width-1,$height-1,$black);
ImageLine($pic,rand(5,45),rand(5,35),rand(50,75),rand(5,35),$silver);
ImageLine($pic,rand(5,45),rand(5,35),rand(50,75),rand(5,35),$silver);
ImageLine($pic,rand(40,60),rand(5,35),rand(40,60),rand(5,35),$silver);


for($i=0;$i<300;$i++)
{
$los1 = rand(1,$width-2);
$los2 = rand(1,$height-2);

ImageLine($pic,$los1,$los2,$los1,$los2,$gray);
}


ImageTtfText($pic,rand(12,20),400-rand(1,80),rand(5,20),rand(20,30),$colors[rand(0,5)],"fonts/font_".rand(1,20).".ttf",$symbols[rand(0,55)]);
ImageTtfText($pic,rand(12,20),400-rand(1,80),rand(25,40),rand(20,30),$colors[rand(0,5)],"fonts/font_".rand(1,20).".ttf",$symbols[rand(0,55)]);
ImageTtfText($pic,rand(12,20),400-rand(1,80),rand(45,60),rand(20,30),$colors[rand(0,5)],"fonts/font_".rand(1,20).".ttf",$symbols[rand(0,55)]);
ImageTtfText($pic,rand(12,20),400-rand(1,80),rand(65,70),rand(20,30),$colors[rand(0,5)],"fonts/font_".rand(1,20).".ttf",$symbols[rand(0,55)]);



Header("Content-type: image/gif");
ImageGIF($pic);
ImageDestroy($pic);

?>


Ten post edytował XP'ek 2.09.2010, 23:51:11
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Mówiąc "inkluduje" masz na mysli include lub require? No nic dziwnego. INcludujesz obrazek a obrazek to krzaki....

Takie skrypty obrazkowe to na strone wklada się jak normalne obrazki, czyli:
<img src="skryptgenerujacyobrazek.php" />


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
XP'ek
post
Post #3





Grupa: Zarejestrowani
Postów: 263
Pomógł: 9
Dołączył: 3.05.2009
Skąd: Wroc

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


hehe dzieki ca pomoc ze mi nie przyszlo do głowy winksmiley.jpg
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 Aktualny czas: 22.08.2025 - 08:47