오늘은 소설입니다.
sun's longitude:240 03 34.38 
· 자유게시판 · 묻고답하기 · 알파문서 · RPMS list
· 사용자문서 · 팁/FAQ모음 · 리눅스Links · 자료실
· 서버정보 · 운영자 · Books/FAQ · FreeBSD
/board/delete.php:소스보기  
알파문서
자주 잊어먹거나, 메모해 둘 필요성이 있는 팁이나 문서, 기타 등등
[*** 쓰기 금지단어 패턴 ***]
글 본문 중간에 업로드할 이미지를 추가하는 방법 : @@이미지이름@@
ex) @@foo.gif@@
 ★ 글 지우기 항목입니다. 한번 더 생각하시고 결정하십시오.!!!
제목 55 : [PHP] base64 encoded images
 이름  산이 [홈]http://linuxchannel.net/
## base64 encoded images
##
$images['null'] = 'R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['_brown'] = 'R0lGODlhAQABAIAAAH8AAP///ywAAAAAAQABAAACAkQBADs=';
$images['_blue'] = 'R0lGODlhAQAJAJEAAAAAAP///wAA/zc/PywAAAAAAQAJAAACA5RvUwA7';
$images['_green'] = 'R0lGODlhAQAJAJEAAAAAAP///zc/PzF6CywAAAAAAQAJAAACA5xvUgA7';
$images['_margenta']= 'R0lGODlhAQAJAJEAAAAAAP///9MAizc/PywAAAAAAQAJAAACA5RvUwA7';
$images['_yellow'] = 'R0lGODlhAQAJAJEAAAAAAP///zc/P/v8nywAAAAAAQAJAAACA5xvUgA7';
$images['blue'] = 'R0lGODlhAQABAIAAAAAA/wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['darkblue'] = 'R0lGODlhAQABAIAAAEpYogAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['pureblue'] = 'R0lGODlhAQABAIAAAD13swAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['brown'] = 'R0lGODlhAQABAIAAAHsAAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['green'] = 'R0lGODlhAQABAIAAAAB9RQAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['grey'] = 'R0lGODlhAQABAIAAAOjs6AAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['lightgrey']= 'R0lGODlhAQABAIAAANHY0gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['darkgrey'] = 'R0lGODlhAQABAIAAAIycjwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['margenta'] = 'R0lGODlhAQABAIAAANsAmgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['red'] = 'R0lGODlhAQABAIAAANxEHAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
$images['yellow'] = 'R0lGODlhAQABAIAAAP/3AAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';


shell> which base64
alias base64='/usr/lib/python1.5/base64.py'
/usr/lib/python1.5/base64.py
shell> base64 -e foo.gif > foo.gif.enc

<?php
function header_imcache($days=1)
{
global $_SERVER; // for PHP/4.0.x

$expire = (int)$days * 86400; // alway $days > 0

$time['req'] = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); // request time
$time['cur'] = time(); // current time
$time['chk'] = $time['cur'] - $expire; // filemtime() bad speed

if($time['req'] > $time['chk']) // exclude '='
{
header('HTTP/1.1 304 Not Modified');
exit; // don't print any messages
}

header('Expires: '.gmdate('D, d M Y H:i:s T',$time['cur']+$expire));
header('Last-Modified: '.gmdate('D, d M Y H:i:s T')); // GMT of current
header('Cache-control: private, max-age='.$expire.', pre-check='.$expire);

return TRUE; // alway true
}

header_imcache();

$images = array();
$images['null'] = '....';
...
$images['yellow'] = '....';

$color = 'red'; // color name
header('Content-type: image/gif');
echo base64_decode($images[$color]);
exit; // don't print any messages
?>
2003년 08월 12일 12:30:22 화(오후)  from 61.254.75.40
0
암호: 공용 보안 SSL 서버가 준비되기 전까지는 off 합니다

apache lighttpd linuxchannel.net 
Copyright 1997-2024. linuxchannel.net. All rights reserved.

Page loading: 0.01(server) + (network) + (browser) seconds