250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- html5
- 비전공 개발자
- MAC
- keyframes
- 자바스크립트
- button
- IOS
- 프론트엔드
- CSS
- 개발자
- xcode
- Animation
- react
- SWIFT
- HTML
- 백엔드
- front-end
- iPhone
- ipad
- effect
- 풀스택
- 비전공자
- php
- jQuery
- css3
- javascript
- 애니메이션
- hover
- iOS 개발자
- image
Archives
- Today
- Total
비전공자 개발일기
PHP imagecreatefrompng / ImageColorAllocate / ImageTTFText 본문
728x90
SMALL
<?php
$area = ($_GET['area']) ? $_GET['area'] : "";
$name = ($_GET['name']) ? $_GET['name'] : "이름없음";
$font = $_SERVER['DOCUMENT_ROOT'].'/fonts/font1.ttf';
$size = "80";
switch($area){
case "서울시":
break;
case "경기도":
break;
case "인천시":
break;
case "충청북도":
$img = $_SERVER['DOCUMENT_ROOT']."/UPLOAD/area/back3.png";
$im2 = imagecreatefrompng($img);
$gray = ImageColorAllocate($im2,80,80,80);
ImageTTFText($im2,$size,0,imagesx($im2)-400,imagesy($im2)-170,$gray,$font,$name);
break;
case "충청남도":
break;
case "대전시":
break;
case "세종시":
break;
case "경상북도":
break;
case "경상남도":
break;
case "대구시":
break;
case "울산시":
break;
case "부산시":
break;
case "강원도":
break;
case "전라북도":
break;
case "전라남도":
break;
case "전주시":
break;
case "광주시":
break;
case "제주도":
break;
}
header('Content-Type: image/png');
$filename = "{$name}_서약서.png";
$filepath = $_SERVER['DOCUMENT_ROOT']."/UPLOAD/pledge/{$filename}";
imagepng($im2, $filepath);
imagedestroy($im2);
$filesize = filesize($filepath);
header("Pragma: public");
header("Expires: 0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename={$filename}");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $filesize");
ob_clean();
flush();
readfile($filepath);
?>
728x90
LIST
'PHP' 카테고리의 다른 글
PHP curl (post) (0) | 2022.02.23 |
---|---|
Function with PHP (변수) (0) | 2022.01.03 |
WHILE, FOR, FOREACH in PHP (0) | 2022.01.02 |
SWITCH CASE with PHP (0) | 2022.01.01 |
PHP with if condition (0) | 2021.12.31 |