Autor | Zpráva | ||
---|---|---|---|
MKaty Profil |
#1 · Zasláno: 14. 10. 2007, 11:13:57
Dobrý den,
mám problém se změnou typu dokumentu. Chci si udělat počítadlo a nechci ho dělat přes include. obrazek.php: <? Header("Content-type: image/jpeg"); echo "Text"; ?> Když obrázek zobrazim samotný tak funguje zde. Ale jinak ne. Tady ukázka. |
||
Mike8748 Profil |
#2 · Zasláno: 14. 10. 2007, 11:28:50
>> Header("Content-type: image/jpeg");
kdyz uz pouzijes tuto, tak se ceka ze na vystup odesles nejakej obrazek, ne text |
||
MKaty Profil |
#3 · Zasláno: 14. 10. 2007, 11:46:25
Bez něj to nepůjde?
|
||
MKaty Profil |
#4 · Zasláno: 14. 10. 2007, 11:47:01 · Upravil/a: MKaty
Jak jinak použiju skript aniž bych použil require či include. (tedy jen HTML)
|
||
joejoe Profil * |
#5 · Zasláno: 14. 10. 2007, 12:55:00
do obrazek php musis napsat:
<?php header('content-type: image/jpeg'); echo file_get_contents('./2.jpeg'); // OMG! kdyz mas v hlavicce jpeg, tak neposilej BMP ?> pripadne muzes pouzit: <?php $text = "chci napsat cislo 2"; $pocet_znanku = strlen($text); $im = imagecreate(10*$pocet_znanku, 15); // white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); // write the string at the top left imagestring($im, 5, 0, 0, $text, $textcolor); // output the image header("Content-type: image/png"); imagepng($im); ?> |
||
Časová prodleva: 17 let
|
0