 |
TEXT 2 IMAGE โหลดมาลองทำแล้วมันไม่ได้อะค่ะ......Warning: Cannot modify header information - headers already sent by |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
header("Content-type: image/jpeg");
$TEXT = $_GET["t"];
$width = (strlen($TEXT)*6)+5;
Header("Content-type: image/jpeg");
$images = ImageCreate($width,16);
$color = ImageColorAllocate($images,255,255,255);
$photo = ImageColorAllocate($images,0,0,0);
ImageString($images, 2, 0, 0, $TEXT, $photo);
ImageJpeg($images);
ImageDestroy($images);
?>
<img src='text2image.php?t=thaicreate.com'/>
มันขึ้นแบบนี้
Code
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\text2image.php:9) in D:\AppServ\www\text2image.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\text2image.php:9) in D:\AppServ\www\text2image.php on line 13
����JFIF��>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ��C $.' ",#(7),01444'9=82<.342��C 2!!22222222222222222222222222222222222222222222222222��"�� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������� ���w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��(��?��
Tag : PHP, CakePHP
|
|
 |
 |
 |
 |
Date :
2010-10-18 22:46:40 |
By :
nuo0onew |
View :
1040 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไฟล์ text2image.php
Code (text2image.php)
<?php
header("Content-type: image/jpeg");
$TEXT = $_GET["t"];
$width = (strlen($TEXT)*6)+5;
Header("Content-type: image/jpeg");
$images = ImageCreate($width,16);
$color = ImageColorAllocate($images,255,255,255);
$photo = ImageColorAllocate($images,0,0,0);
ImageString($images, 2, 0, 0, $TEXT, $photo);
ImageJpeg($images);
ImageDestroy($images);
?>
ไฟล์ test.php
Code (PHP)
<img src="text2image.php?t=test"/>
|
 |
 |
 |
 |
Date :
2010-10-18 23:05:03 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ PHP เวอร์ชันอะไรครับ
|
 |
 |
 |
 |
Date :
2010-10-19 00:01:47 |
By :
manosate |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เกี่ยวกับ version หรอกครับ
ใช้
header("Content-type: image/jpeg");
แต่ไปแสดง output ออกมามันเลย error
ทำตาม rep 1 ครับ
|
 |
 |
 |
 |
Date :
2010-10-19 01:52:14 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

มันเป็นแบบนี้อะค่ะ
|
ประวัติการแก้ไข 2010-10-19 09:59:09
 |
 |
 |
 |
Date :
2010-10-19 09:58:12 |
By :
nuo0onew |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|