영원한사랑

인터넷정보 +1252
<form action='' enctype="multipart/form-data">

<input type=text name=photo class="in_gray" size="50" maxlength="50">
<span style="overflow:hidden; width:61; height:20; background-image:url(http://blogimgs.naver.com/imgs/btn_addphoto.gif);">
<input  type='file' name=attachedfile style="width:0;height:20;filter:alpha(opacity=0);" onchange='photo.value=this.value'>
</span>

</form>


자체 태그로 바꾸는 것이 아니라,

textbox로 것을 보이고,

file를 작게 만들고 그 바닥에 이미지를 붙이고,

file의 알파값을 0으로 바꾼 것

file의 값이 바뀌면 textbox값이 바뀐다.

1. 즐겨찾기 메뉴

window.external.AddFavorite('http://oxtag.com/','태그피아') 스크립트가 실행되도록 하시면 됩니다.
ex) <A HREF='#' OnClick="{window.external.AddFavorite('http://oxtag.com','태그피아')}">


2. 시작페이지 설정

시작페이지 설정시 아래의 스크립트를 쓰시면 됩니다.
<a href="#" onClick="this.style.behavior!!='url(#default#homepage)';this.setHomePage('http://oxtag.com');">




style="Z-INDEX: 1; LEFT: 1015px; ; LEFT: expression!((document.body.clientWidth+auctionWidth)/2); MARGIN-LEFT: 6px; POSITION: absolute; TOP: 42px"












$type =  substr(strrchr($_FILES['st_professor_img']['name'], "."), 1);











error_reporting

(PHP 3, PHP 4 , PHP 5)

error_reporting -- Sets which PHP errors are reported

Description

int error_reporting ( [int level])

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script.

error_reporting() sets PHP's error reporting level, and returns the old level. The level parameter takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. As error levels are added, the range of integers increases, so older integer-based error levels will not always behave as expected.

예 1. error_reporting() examples

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>

The available error level constants are listed below. The actual meanings of these error levels are described in the predefined constants.

표 1. error_reporting() level constants and bit values

value constant
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
2047 E_ALL
2048 E_STRICT

주의

With PHP > 5.0.0 E_STRICT with value 2048 is available. E_ALL does NOT include error levelE_STRICT.

See also the display_errors directive and ini_set().


error_reporting(E_ALL);  //모든 에러 출력 설정

높이만


<iframe name="iframe1" src="about:blank" width="600" height="0" frameborder="0" onload="this.style.height=this.contentWindow.document.body.scrollHeight;"></iframe>




너비와 높이


<iframe name="iframe1" src="about:blank" width="600" height="0" frameborder="0" onload="this.stylewidth=this.contentWindow.document.body.scrollWidth;this.style.height=this.contentWindow.document.body.scrollHeight;"></iframe>


http://blog.1nooncorp.com/index.php?pl=8&ct1=4



REGEDIT4


[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain]
"Use Search Asst"="no"
"Search Page"="http://www.1noon.com"
"Search Bar"="http://www.1noon.com/ie_search.nsp"

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchURL]
""="http://total.1noon.com/search.nsp?q=%s"
"provider"="1noon"

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerSearch]
"SearchAssistant"=http://www.1noon.com/ie_search.nsp



위 레지스트리 구문을

XXX.reg로 저장해서 실행하면

첫눈이라는 검색페이지가 검색 엔진으로 등록됩니다.

형식만 다른 곳도 등록이 가능합니다. 아마도


링크를 참고하세요.

function normalize_phonenum(this_s)
{
    this_s.value = this_s.value.toString().replace(/(0(?:2|[0-9]{2}))([0-9]+)([0-9]{4}$)/,"$1-$2-$3");
}


//정규식을 이용한 방법을 수정한 것




function ck_telephone(this_s)
   {
   //02-281-4248;  --> 9
   //052-281-4248;  --> 10
   //052-2281-4248;  --> 11
   //0522-281-4248;  --> 11
   bs_number = this_s.value.toString();
   bs_number = bs_number.replace(/[^0-9]/g,'');
   bs_number_length = bs_number.length;
   t_limit1 = 2 // 처음 번호까지 거리
   bs_1 = '';
   bs_2 = '';
   t_limit1 = 0;
   if(bs_number_length >= 9){
    ck_1 = bs_number.substr(0, 2);
    if(ck_1 != '02'){ t_limit1 = 3; }else{ t_limit1 = 2; }
   }  
   t_st2 = 0;
   t_limit3 = 4;
   if(bs_number_length < 4) { t_limit3 = bs_number_length;}
   t_st2 = t_limit1;
   t_limit2 = bs_number_length -t_limit3-t_limit1;
   
   t_st3 = bs_number_length - t_limit3; if(t_st3 < 0 ) { t_st3 = 0 ; }
   result = '';
   bs_3 = bs_number.substr(t_st3, t_limit3);
   if(bs_number_length > 4 ){  bs_2 = bs_number.substr(t_st2, t_limit2); }
   if(bs_number_length >= 9  ){  bs_1 = bs_number.substr(0, t_limit1 );  }
   
    if(bs_3.length != 0)
    { result += bs_3; }
    if(bs_2.length != 0)
    { result = bs_2 +'-'+ result; }
    if(bs_1.length != 0)
    { result = bs_1 +'-'+ result; }
   
    this_s.value = result;
   }
 


<input name="u_com_tel" type="text" id="u_com_tel" size="30" maxlength="50"  onChange="ck_telephone(this);" onBlur!!="ck_telephone(this);" >

<html>
<head>
<title>제목없음</title>

<style type="text/css">
<!--
body  { margin:0px; overflow:hidden; background-color:#f4f4f4; color:#000000; font-family:Arial,Helvetica; font-size:10px; }
.dropb {
        font:  normal 9px Small Fonts, VT100, Arial, Helvetica;
        color: #505050;
        border:2px solid #000000;
        width: 115px;
}
--></style>
</head>
<body>

<div style="position:relative;margin-right:7px;width:117px;height:18px;border:1px solid #000000;background-color:#FFFFFF">
<div style="position: absolute;left:0px;top:-1px;width:115px;height:17px;clip:rect(2,113,15,2);">
<SELECT class="dropb">
<option value="" SELECTED>FRIENDLY LINKS
<option value="">- - - - - - - - - - - - - - - - - - - - - - - - - -
<option value="http://www.webarkstudio.com">WEBARKSTUDIO
<option value="http://www.copyrightmagazine.com">COPYRIGHTMAGAZINE
<option value="http://www.publircidad.com">PUBLIRCIDAD
<option value="http://www.e-site-es.com">E-SITE
<option value="http://www.creatiu.com">CREATIU
<option value="http://www.offf.org">OFFF
</select>
</div>
</div>

</body>
</html>

<script>
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}

if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
</script>

<div id="showimage" style="position:absolute;width:250px;left:300px;top:200px">
<table border="1" onMousedown="initializedragie()" style="cursor:hand" >
<tr>
   <td> 움직일.. 레이어창.. </td>
  </tr>
</table>

</div>

<script language="javascript">
function ieExecWB( intOLEcmd, intOLEparam )
{
// 웹 브라우저 컨트롤 생성
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
 
// 웹 페이지에 객체 삽입
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
 
// if intOLEparam이 정의되어 있지 않으면 디폴트 값 설정
if ( ( ! intOLEparam ) || ( intOLEparam < -1 )  || (intOLEparam > 1 ) )
        intOLEparam = 1;
 
// ExexWB 메쏘드 실행
WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
 
// 객체 해제
WebBrowser1.outerHTML = "";
}
 
</script>
 
<input type=button value="인쇄 미리 보기" onclick="window.ieExecWB(7)">  
<input type=button value="페이지 설정" onclick="window.ieExecWB(8)">  
<input type=button value="인쇄하기(대화상자 표시)" onclick="window.ieExecWB(6)">  
<input type=button value="인쇄 바로 하기" onclick="window.ieExecWB(6, -1)">

create table if not exists board (  

  uid int unsigned not null primary key auto_increment,

  index top (top)

);











ActiveX의 버전관리는 사용자나 웹관리자에게 편리함을 제공해준다.


새로운 버전의 콘트롤이 제작될때마다 자동으로 다운로드하여 설치하기 때문이다.


그러나 제작자의 입작에서는 상당히 까다로운 부분이기도 하다.

한번 버전이 엉킨 AcitveX는 사용자가 일일이 uninstall을 시키거나 아주 높은 버전을 주어야 한다.


그러나 태그에 CODEBASE의 버전을 이용하면 버전에 관계없이 인스톨하게 할 수 있다.


????.cab#version=1,0,0,1 ....

version이라고 쓰여진 부분이 컨트롤의 버전이다.

이 부분을 "version=-1,-1,-1,-1"라고 명시하면 무조건 받게 된다.

<img id='Img1' src='http://www.phpschool.com/images/LOGO.gif' width='100' onclick='alertImgSize(this)'> 
<script> 
function alertImgSize(ElemId) { 
      var Size = GetImageSize(Img1); 
      alert('Width: ' + Size.Width + ', Height: ' + Size.Height); 
} 
</script> 

<script> 
function GetImageSize(ElemId) { 
      with(TmpImg = document.body.appendChild(document.createElement('img'))) { 
            src = ElemId.src; 
            var Width = offsetWidth; 
            var Height = offsetHeight; 
      } 
      document.body.removeChild(TmpImg); 
      return { Width : Width, Height : Height }; 
} 
</script> 

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

<img src="어쩌구저쩌구" width="100" name="asdasd">  
<script> 
var img=new image(); 
img.src=document.all.asdasd.src; 
alert(img.width); 
</script> 


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


원리
이미지의 SRC를 가져와서 새 이미지객체를 만든다.
새로 만들어진 이미지객체는 본래 이미지의 크기를 가진다.
그 크기를 알아낸다.
이미지 객체는 지운다.

function auto_resize()
{
try{

//------ 스크롤이 있을 때
// v_width = document.body.scrollWidth + 22;
// v_height = document.body.scrollHeight + 25;

//------ 스크롤이 없을 때

 v_width = document.body.scrollWidth + 6;
 v_height = document.body.scrollHeight + 25;

 window.self.resizeTo!(v_width,v_height);
}

function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie! = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


사용법

function closeWin()
{
if ( document.pop.Notice.checked )
setCookie( "Notice", "done" , 1); // 오른쪽 숫자는 쿠키를 유지할 기간을 설정합니다
self.close();
}


쿠키 삭제법

setCookie( "Notice", "" , 0 ); // 오른쪽 숫자는 쿠키를 유지할 기간을 설정합니다


function getCookie( name ){
  var nameOfCookie = name + "=";
  var x = 0;
  while ( x <= document.cookie!.length )
  {
    var y = (x+nameOfCookie.length);
    if ( document.cookie!.substring( x, y ) == nameOfCookie ) {
      if ( (endOfCookie=document.cookie!.indexOf( ";", y )) == -1 )
        endOfCookie = document.cookie!.length;
        return unescape( document.cookie!.substring( y, endOfCookie ) );
    }
    x = document.cookie!.indexOf( " ", x ) + 1;
    if ( x == 0 )
      break;
    }
    return "";
}


사용법

cookie_value = getCookie( name );

mime_content_type

(PHP 4 >= 4.3.0, PHP 5)

mime_content_type -- Detect MIME Content-type for a file

Description

string mime_content_type ( string filename)

Returns the MIME content type for a file as determined by using information from the magic.mime file. Content types are returned in MIME format, like text/plain or application/octet-stream.

예 1. mime_content_type() example

<?php
echo mime_content_type('php.gif') . " "
;
echo
mime_content_type('test.php'
);
?>

The above example will output:

image/gif
text/plain


 


mime_content_type() 함수가 없을 경우


<?php

if (!function_exists('mime_content_type')) {
function mime_content_type($f) {
$f = escapeshellarg($f);
return trim( `file -bi $f` );
}
}
$f = "./nbuilder/login.gif";
$gg = mime_content_type($f);
echo"$gg";
?>

<?php

  header
("Content-type: image/png");  
//이미지 타입에 맞도록 해더 구성

 
$im = imagecreate(400, 30);
// 이미지 기본 판 만들기

 
$white = imagecolorallocate($im, 255, 255, 255);
//색상

 
$black = imagecolorallocate($im, 0, 0, 0);
//색상

 
$bg = imagecolorallocate($im, 0xF2, 0xE2, 0xD2);
//색상 16진수 사용

  // Replace path by your own font path

 
$str_input = "한글은 잘되나? English output is well. 月火水木金土日"
;

 
$str_input = iconv("EUC-KR","UTF-8",$str_input);
// UTF-8로 한글 변경

 
imagefill($im,0,0, $bg);
//배경 칠하기

 
imagettftext($im, 10, 0, 10, 20, $black, "/gulim.ttc",$str_input);
//글자 적기

 
imagepng($im);
//png 형식으로 이미지 표시

 
imagedestroy($im);
//이미지 제거

?>

인터넷 익스플로러 다운로드 제한 수 변경하는 방법



1. [시작]→[실행]에서 [regedit]를 입력하고 레지스트리 편집기를 실행한후, 다음키 값을 찾는다.


2.HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionInternet Settings


3. 이 키 또는 오른쪽 창의 빈 공간을 마우스 오른쪽 버튼으로 클릭하고 [등록]→[DWORD 값]을 선택한다.


4. 새 DWORD 값의 이름에 [MaxConnectionsPerServer]라고 입력한다.


5. 이 값을 더블클릭하고 값의 데이터 란에 원하는 다운로드 갯수를 입력한다







Script // object.style.imeMode=[sVal]

HTML // <ELEMENT style="ime-mode:sVal;">

CSS // cssSelector {ime-mode:sVal;}

 


cssSelector : (스타일 선택자)
<SCRIPT>showProp()</SCRIPT> imeMode 속성을 가질수 있는 엘레멘트( <SCRIPT>document.write(applyElem)</SCRIPT> ELEMENT)나 클라스(class) 이름 혹은 인식자(id)이다.
<SCRIPT>showPropVal()</SCRIPT> sVal : (속성 문자열)
<SCRIPT>showProp()</SCRIPT> imeMode 스타일 속성은 개체 속의 텍스트에 사용되는 글꼴의 굵기를 나타내는 문자열이다.
auto 디폴트이며, IME가 첨부되어 있지 않다. 이는 ime-mode 애트리뷰트가 지정되지 않은 것과 같다.
active 모든 글자들이 IME를 통하여 입력되었다. 사용자는 IME를 불활성화 시킬 수 있다.
inactive 모든 글자들이 IME를 통하지 않고 입력되었다. 사용자는 IME를 활성화 시킬 수 있다.
disabled IME가 완전히 불활성화 되었다. 사용자는 IME를 활성화 시킬 수 없다.

이 속성은 currentStyle에서는 읽기전용이고, 그외의 개체에서는 읽기/쓰기이며, 디폴트값은 auto이다.

CSS(Cascading Style Sheets) 애트리뷰트는 상속된다.


ime-mode:active

로 설정할 경우 한국어를 기본으로 사용할 경우 기본 한국어가 입력된다.

ime-mode:inactive

기본으로 영어가 적히게 된다.

getElementsByTagNameNS() 는 getElementsByTagName()의 사촌 쯤 되는데,
NS 가 붙는 이유는 NameSpace를 사용하기 때문이다.

getElementsByTagName('TagName');
처럼 쓰지만.
getElementsByTagNameNS('NameSpace','TagName');
처럼 쓴다.
('NameSpace','TagName' 문자열에 *를 대신 사용하면 모든것을 지칭하게된다.)


네임 스페이스를 XML등에 사용할 때 표시법


위 소스는 RSS에서 사용되는 방법으로
aaa 라는 네임스페이스를 정의하는데
http://test.com/aaa/ 에서 참고한다는 표현이다.

네임 스페이스를 포함한 태그

~~~~
위 태그는 aaa라는 네임스페이스에 포함된 bbb라는 태그의 사용을 나태낸 것이다.
보통의 HTML에서는 저런 형식은 사용되지 않지만, XML(RSS는 XML을 이용한 것)에서는 꽤 자주사용되는 표현이다.


네임스페이스가 포함된 객체를 tagName로 가져오기

var bbb = document.getElementsByTagNameNS('http://test.com/aaa/','bbb');
이렇게 URI를 내타내서 사용하지만

var aaa = 'http://test.com/aaa/';
var bbb = document.getElementsByTagNameNS(aaa,'bbb');
로 사용하는 방법을 추천

여기서 문제가 발생하는데, IE에서는 getElementsByTagNameNS()가 지원되지 않는다.
(FF에서는 지원됨)

IE에서는 네임스페이스사용을 무시하고
var bbb = document.getElementsByTagName('aaa:bbb');
로 사용하면 된다.

여기서 또 문제점이 발생하는데, FF에서는 저런 방식으로 안된다.
FF에서는 네임스페이스를 지원하기 때문에 aaa는 태그가 아니라 네임스페이스로 처리되야한다.
그러므로

var bbb = document.getElementsByTagName('bbb');
모든 bbb태그를 가져오는 방식으로 쓰면 된다.

이건
var bbb = document.getElementsByTagNameNS('*','bbb');
와 같은 결과를 가져올 것이다.


호환성을 생각한 방법
(xmlDoc 은 AJAX로 가져온 XML의 Document이다. 그냥 HTML에서도의 Document와 성질이 같다.)

if(xmlDoc.getElementsByTagNameNS){ //getElementsByTagNameNS 를 지원할 때
  var location = xmlDoc.getElementsByTagNameNS(yweather,'location');
 }else if(xmlDoc.getElementsByTagName('yweather:location')){
 //IE용 : 네임스페이스를 포함해서 태그를 검색할 수 있을 때
  var location = xmlDoc.getElementsByTagName('yweather:location');
 }else{ //그외
  var location = xmlDoc.getElementsByTagName('location');
 }

$anti_tag = array('script','xmp','form');
$search = array();
for($i = 0,$m=count($anti_tag);$i<$m;$i++)
{
$search[] = "'(<)([\/\!]*?)({$anti_tag[$i]})([^<>]*?)(>)'si";
}
$replace = '&lt;\\2\\3\\4&gt;';

$return_str = preg_replace($search,$replace, $text);

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

-> <~~script~~><~~xmp~~> 같은 것을 사용하지 못하도록 바꿔서 출력한다.

obj = document.getElementById('slt_result');

numb=obj.length+1;
newOpt=document.createElement("OPTION");
newOpt.text=str;
newOpt.name=str;
newOpt.value=str;

obj.add(newOpt);
obj.length = numb;

<style type="text/css">
.drag { position: relative; cursor:move }
</style>
<script type="text/javascript">
///------------ 마우스로 객체 드래그
var bdown = false;
var x, y;
var sElem;
//------------------------------------- 숫자 NaN체커
function changeInt(num){ //수평선 님 추가
    var temp = parseInt(num);
    if(isNaN(temp)){
        temp = 0;
    }
    return temp;
}
//------------------------------------ IE/FF 공용처리
function mlayer_down(e) {
  evt = e||window.event;
  stop_bubble(evt)
        sElem = evt.target || evt.srcElement ;
    if(sElem.className == "drag") {
        bdown = true;
        x = evt.clientX;
        y = evt.clientY;
    }
}
function mlayer_up() {
    bdown = false;
}
function mlayer_move(e) {
    if(bdown) {
 evt = e||window.event;
 stop_bubble(evt)
        var distX = changeInt(evt.clientX) - x;
        var distY = changeInt(evt.clientY) - y;
        sElem.style.left =(changeInt(sElem.style.left) + distX)+'px';
        sElem.style.top  = (changeInt(sElem.style.top) + distY)+'px';
        x = changeInt(evt.clientX);
        y = changeInt(evt.clientY);
        return false;
    }
}
function stop_bubble(evt){
  if(window.event){
  window.event.returnValue = true;   
  }else{
  evt.stopPropagation();
  evt.preventDefault()
  }
}
//------------------- 이벤트 등록
if (!document.all){
    //FF도 될 수 있도록
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=mlayer_down;
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = mlayer_move;
    document.captureEvents(Event.MOUSEUP);
    document.onmouseup = mlayer_up;
}
else{
    document.onmousedown = mlayer_down;
    document.onmousemove = mlayer_move;
    document.onmouseup = mlayer_up;
}
</script>
---------------=-------------------
위 스크립트를 첨부하고
<img class='drag' src='xxxx.jpg'>
처럼 하면 됩니다.
그리고나서 이미지를 이동해보세요.

//----------------------------- 오른쪽 마우스 버튼 막기
function right(e) {
 evt = e || event;
    try{
  if (document.all){
   if(evt.button == 2 || evt.button == 3) {    
    stop_event(evt);
    return false;     }
  }else {
   if(evt.which == 3 || evt.which == 2) {   
    stop_event(evt);
    return false; }
  }
    }catch(ex){
  return false;
    }
}
//--------------------------- - - 키보드 입력 막기
function processKey(e){
 evt = e || event;
    try{
  stop_event(evt);
  return false;
    }catch(ex){
  return false;
    }
}
function stop_event(e){
 evt = e || event;
 if(window.event){
 window.event.keyCode = 0;
 window.event.cancelBubble = true;
 window.event.returnValue = true;   
 }else{
 evt.stopPropagation();
 evt.preventDefault();
 evt.initEvent;
 }
}//----------------------------- 이벤트 등록
function dont_left_click(){
 if(document.attachEvent){
 document.attachEvent("onkeydown", processKey );
 document.attachEvent("onmousedown", right );
 }
 else{
 window.captureEvents(Event.MOUSEDOWN);
 window.captureEvents(Event.ONKEYDOWN);
 document.addEventListener("keydown", processKey , false);
 document.addEventListener("mousedown", right , false);
 }
}

<script  type="text/javascript">
var timer_loading=null;
function loading_st(){
 var ct_left = (parseInt(window.screen.width)-450)/2;
 var ct_top = (parseInt(window.screen.height))/3;
 layer_str = "<div id='loading_layer' style='position:absolute; font-size:11pt; left:"+ct_left+"px; top:"+ct_top+"px; width:400px; padding:50px; text-align:center; vertical-align:middle; z-index:1000; font-weight: bold;'>로딩중입니다.</div>"
 document.write(layer_str);
 timer_loading = setTimeout('self.document.location!!.reload()',4000) //4초 동안 페이지 로딩이 완료 안되면 리로드 한다.);

 if(window.attachEvent){
 window.attachEvent('onload', loading_ed)
 }else{
 window.addEventListener('load', loading_ed, false)
 }
}
function loading_ed(){
 var ta =document.getElementById('loading_layer');
 ta.style.display='none';
 clearTimeout(timer_loading)
}
loading_st();
</script>

javascript:var ta = document.scripts;var save_buff = new String();alert(ta.length);for(i=0,m=ta.length;i<m;i++){save_buff += '['+i+']\n'+ta.item(i).outerHTML; } document.write('<xmp>'+save_buff+'</xmp>');


<script>
var ta = document.scripts;
var save_buff = new String();
alert(ta.length);
for(i=0,m=ta.length;i<m;i++){
save_buff += '['+i+']\n'+ta.item(i).outerHTML;
}
document.write('<xmp>'+save_buff+'</'+'xmp>');
</script>

function _b_html_to_text_autolink(&$contents) { //오토 링크
$pattern = "/(http|https|ftp|mms):\/\/[0-9a-z-]+([\._0-9a-z-]+)+(:[0-9]{2,4})?\/?"; // domain+port
$pattern .= "([\.~_0-9a-z-]+\/?)*"; // sub roots
$pattern .= "(\S+\.[_0-9a-z]+)?"; // file & extension string
$pattern .= "(\?[_0-9a-z#%&;=\-\+]+)*"; // parameters
$pattern .= '/i';
$replacement = "\\0";
$contents = preg_replace($pattern, $replacement, $contents, -1);
return $contents;
}

function get_mine_type($exp){
$exp = strtolower($exp);
static $mime_type;
if(!is_array($mime_type)){
$mime_type = array();
$mime_type['dwg']='application/acad';
$mime_type['ccad']='application/clariscad';
$mime_type['dxf']='application/dxf';
$mime_type['mdb']='application/msaccess';
$mime_type['doc']='application/msword';
$mime_type['bin']='application/octet-stream';
$mime_type['pdf']='application/pdf';
$mime_type['ai']='application/postscript';
$mime_type['ps']='application/postscript';
$mime_type['eps']='application/postscript';
$mime_type['rtf']='application/rtf';
$mime_type['rtf']='application/rtf';
$mime_type['xls']='application/vnd.ms-excel';
$mime_type['ppt']='application/vnd.ms-powerpoint';
$mime_type['cdf']='application/x-cdf';
$mime_type['csh']='application/x-csh';
$mime_type['csh']='application/x-csh';
$mime_type['dvi']='application/x-dvi';
$mime_type['js']='application/x-javascript';
$mime_type['latex']='application/x-latex';
$mime_type['mif']='application/x-mif';
$mime_type['xls']='application/x-msexcel';
$mime_type['ppt']='application/x-mspowerpoint';
$mime_type['tcl']='application/x-tcl';
$mime_type['tex']='application/x-tex';
$mime_type['texinfo']='application/x-texinfo';
$mime_type['texi']='application/x-texinfo';
$mime_type['t']='application/x-troff';
$mime_type['tr']='application/x-troff';
$mime_type['roff']='application/x-troff';
$mime_type['man']='application/x-troff-man';
$mime_type['me']='application/x-troff-me';
$mime_type['ms']='application/x-troff-ms';
$mime_type['src']='application/x-wais-source';
$mime_type['zip']='application/zip';
$mime_type['au']='audio/basic';
$mime_type['snd']='audio/basic';
$mime_type['aif']='audio/x-aiff';
$mime_type['aiff']='audio/x-aiff';
$mime_type['aifc']='audio/x-aiff';
$mime_type['wav']='audio/x-wav';
$mime_type['gif']='image/gif';
$mime_type['ief']='image/ief';
$mime_type['jpeg']='image/jpeg';
$mime_type['jpg']='image/jpeg';
$mime_type['jpe']='image/jpeg';
$mime_type['tiff']='image/tiff';
$mime_type['tif']='image/tiff';
$mime_type['png']='image/png';
$mime_type['ras']='image/x-cmu-raster';
$mime_type['pnm']='image/x-portable-anymap';
$mime_type['pbm']='image/x-portable-bitmap';
$mime_type['pgm']='image/x-portable-graymap';
$mime_type['ppm']='image/x-portable-pixmap';
$mime_type['rgb']='image/x-rgb';
$mime_type['xbm']='image/x-xbitmap';
$mime_type['xpm']='image/x-xpixmap';
$mime_type['xwd']='image/x-xwindowdump';
$mime_type['gzip']='multipart/x-gzip';
$mime_type['zip']='multipart/x-zip';
$mime_type['css']='text/css';
$mime_type['html']='text/html';
$mime_type['htm']='text/html';
$mime_type['txt']='text/plain';
$mime_type['rtx']='text/richtext';
$mime_type['tsv']='text/tab-separated-values';
$mime_type['xml']='text/xml';
$mime_type['etx']='text/x-setext';
$mime_type['xsl']='text/xsl';
$mime_type['mpeg']='video/mpeg';
$mime_type['mpg']='video/mpeg';
$mime_type['mpe']='video/mpeg';
$mime_type['mov']='video/quicktime';
$mime_type['qt']='video/quicktime';
$mime_type['avi']='video/x-msvideo';
$mime_type['movie']='video/x-sgi-movie';
$mime_type['swf']='application/x-shockwave-flash';
}
if(isset($mime_type[$exp])){
return $mime_type[$exp] ;
}else{
return false;
}
}

<?
//GD를 이용한 이미지 리사이즈 함수

//$img_file    :    원본파일
//$simg_name    :리사이즈 파일 : 없을 경우 이미지를 직접출력합니다.
//*리사이즈와 워터 마크를 사용하지 않을 경우 직접 출력하는건 효율성이 떨어집니다.
//(직접 출력의 경우 header가 수정되기 때문에 다른 출력이 있으면 안됩니다.)
//$simg_width    :리사이즈 너비
//$simg_height    :리사이즈 높이
//* $simg_width와$simg_height 가 둘다 없을 경우 원본크기 그대로 작업합니다.
//$simg_type        :리사이즈 파일타입 (1:gif , 2:jpg , 3:png) : 기본 gif
//$simg_str : 워터마크 문자열  (시작 위치:10px,20px ) 폰트는 gulim.ttc 지만, 없을 경우 기본 폰트로 시도한다.

function gd_image_resize($img_file,$simg_name='', $simg_width='', $simg_height='', $simg_type=1,$simg_str=''){

if(!is_file($img_file)){    return '원본 파일이 없습니다.'; }
//if(!$simg_name){     return '리사이즈 파일이름이 없습니다.'; } : 리사이즈 파일 이름이 없으면, 이미지로 그냥 출력합니다.
//if(!$simg_width && !$simg_height){     return '너비 와 높이 둘중 하나는 값이 있어야합니다'; } : 원본 크기로 작업합니다.

// GD 버젼체크
$gd = gd_info();
$gdver = substr(preg_replace("/[^0-9]/", "", $gd['GD Version']), 0, 1);
if(!$gdver) return "GD 버젼체크 실패거나 GD 버젼이 1 미만입니다.";

list($img_width, $img_height, $img_type, $img_attr) = getimagesize($img_file); //소스이미지파일 크기
if(!$simg_width && !$simg_height){
    $simg_width = $img_width;
    $simg_height = $img_height;
}else if(!$simg_width){
    $simg_width = $img_width * ($simg_height/$img_height);    //자동 비율생성 : 너비
}else if(!$simg_height){
    $simg_height = $img_height * ($simg_width/$img_width);    //자동 비율생성 : 높이
}
/*
지원 이미지 타입
1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order),
9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM.
1,2,3 만 지원하도록한다.
*/
if($img_type<1 && $img_type > 3){
    return "GIF,JPG,PNG 가 아닙니다.";
}

if($img_type==1){
$img_im = imagecreatefromgif($img_file);            //원본 이미지: gif
}else if($img_type==2){
$img_im = imagecreatefromjpeg($img_file);            //원본 이미지: jpg
}else if($img_type==3){
$img_im = imagecreatefrompng($img_file);            //원본 이미지: png
}else{
    return "지원되는 이미지형식(GIF,JPG,PNG)이 아닙니다.";
}

if($gdver >= 2){    //GD 2.XX    : truecolor로 작업한다.
    $simg_im = imagecreatetruecolor($simg_width, $simg_height);
    imagecopyresampled($simg_im, $img_im, 0, 0, 0, 0, $simg_width, $simg_height,$img_width, $img_height); //이미지를 리사이즈한다.
}else{ //GD 1.xxx
    $simg_im = imagecreate($simg_width, $simg_height);
    imagecopyresized($simg_im, $img_im, 0, 0, 0, 0, $simg_width, $simg_height,$img_width, $img_height);     //이미지를 리사이즈한다.
}

if($simg_str){
  $color_000000 = imagecolorallocate($simg_im, 0, 0, 0); //색상 : 검정
  $color_FFFFFF = imagecolorallocate($simg_im, 0xFF, 0xFF, 0xFF); //색상 : 흰색
  $simg_str = iconv("EUC-KR","UTF-8",$simg_str); // UTF-8로 한글 변경
  $font_file = dirname(dirname(__FILE__)).'/_m_comm/HYCYSM.TTF';
  @imagettftext($simg_im, 10, 0, 6, 21, $color_000000, $font_file,$simg_str); //글자 적기
  @imagettftext($simg_im, 10, 0, 5, 20, $color_FFFFFF, $font_file,$simg_str); //글자 적기
//  @imagettftext($simg_im, 10, 0, 12, 22, $color_000000, "",$simg_str); //글자 적기
//  @imagettftext($simg_im, 10, 0, 10, 20, $color_FFFFFF, "",$simg_str); //글자 적기

}


if($simg_name){
    if($simg_type==1){
        imagegif($simg_im,$simg_name);            //원본 이미지: gif
    }else if($simg_type==2){
        imagejpeg($simg_im,$simg_name,80);            //원본 이미지: jpg
    }else if($simg_type==3){
        imagepng($simg_im,$simg_name);            //원본 이미지: png
    }
}else{
        Header("Content-Disposition: attachment; filename=".basename($img_file));
        header("Content-Transfer-Encoding: binary");
    if($simg_type==1){
        header("Content-type: image/gif");  //이미지 타입에 맞도록 해더 구성
        imagegif($simg_im);            //원본 이미지: gif
    }else if($simg_type==2){
        header("Content-type: image/jpg");  //이미지 타입에 맞도록 해더 구성
        imagejpeg($simg_im,'',80);            //원본 이미지: jpg
    }else if($simg_type==3){
        header("Content-type: image/png");  //이미지 타입에 맞도록 해더 구성
        imagepng($simg_im);            //원본 이미지: png
    }
}

// 메모리에 있는 그림 삭제
imagedestroy($img_im);
imagedestroy($simg_im);

return '이미지 리사이즈 완료';

}
?>

http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=45236