Search Results for '프로그래밍'


1206 posts related to '프로그래밍'

  1. 2019/03/20 네아로 아이디만 로그인 유지 아닐경우 세션 날려버리기 로그아웃 하기
  2. 2019/03/12 특정 페이지만 리다이렉트 하기.
  3. 2019/03/11 로그인후 5분동안 사용없으면 로그아웃 하기 - 그누보드
  4. 2019/03/11 로그인후 5분동안 사용없으면 로그아웃 하기 - 그누보드
  5. 2019/02/19 스토어팜 찜하기 링크 주소
  6. 2018/10/08 그누보드 영카트 서브도메인 접속 방법
  7. 2018/10/01 2차 도메인 서브도메인 .htaccess 처리 하기
  8. 2018/09/27 데이터의 크기
  9. 2018/09/27 2017-07이나 2017-7을 정규식으로 표현할 경우
  10. 2018/09/27 기본 정규식 이해
  11. 2018/08/19 MySql - update의 그누보드5 활용
  12. 2018/08/15 Xpenology(헤놀로지=시놀로지) DSM 6.1.7 15284 Update 2 설치 준비물
  13. 2018/08/14 네이버 톡톡 링크 주소로 채팅창 사이즈 조절 - 그누보드
  14. 2018/08/13 그누보드 조건에 맞게 출력하기 - 모바일,관리자,PC,메인
  15. 2018/08/11 이미지 비포 애퍼터 구현해주는 jQuery 플로그인 입니다.
  16. 2018/08/07 네이버 openapi 사용하여 쇼핑검색 만들기
  17. 2018/08/07 사진슬라이더 네비게이션&체크박스 등 다양한 효과,디자인 소스 모음
  18. 2018/08/04 Windows and Linux pscp 파일 복사
  19. 2018/08/03 생성함수 - 배열 중간에 값 제거
  20. 2018/08/03 생성함수 - 서브도메인 가져오기
  21. 2018/08/03 파일질라 새로 설치시 기존 환경설정, 개인설정 이전 방법
  22. 2018/08/03 도메인 정보를 확인 할 때 www를 제외하기
  23. 2018/08/03 curl 이용하여 파싱하기
  24. 2018/08/03 한글 음소 나누기
  25. 2018/08/03 스택(stack)을 이용한 사칙연산(+ - * /) 계산기
  26. 2018/08/03 화이트 도메인, 실시간 스팸 차단 리스트(메일 보내기 허용)
  27. 2018/08/03 PHP 유용한 일반 함수 모음 (PHP)
  28. 2018/08/03 모바일일때만 보이고 안보이고
  29. 2018/08/03 PHP 문자열 자르기, substr()
  30. 2018/08/03 SEO 사이트맵 제작 프로그램
$mb_id=substr("abcd", 0, 3);
echo("'$mb_id'");
$mb_id=substr("abcd", 2, 3);
echo("'$mb_id'");
$mb_id=substr("abcd", -1);
echo("'$mb_id'");
 
결과 'abc'  'cde'  'd' 로 나온다.
2019/03/21 13:07 2019/03/21 13:07
<?php 
@session_save_path($DOCUMENT_ROOT."/data/session");
@session_start();
if(substr($member[mb_id], 0, 2) != 'n_') {
    unset( $_SESSION["ss_mb_id"] );
    echo "<script>";
    echo "alert('네이버 아이디로 로그인해 주세요.');";
    echo "history.go(-1);";
    echo "</script>";
    exit;
}
?>

그누보드 기반으로 제작 할때 사용하면 됩니다.


2019/03/20 21:50 2019/03/20 21:50
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} !/bbs/board.php.?+bo_table=grouppurchase&wr_id= [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
# force http:// for selected URLs
RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} /bbs/board.php.+?bo_table=grouppurchase&wr_id= [NC]
RewriteCond %{THE_REQUEST} /bbs/board.php.+?bo_table=grouppurchase&wr_id= [NC]
ewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
2019/03/12 13:02 2019/03/12 13:02
<? 
/////////////////////5분 후 자동 로그아웃 ///////////// 
if($member[mb_id]) 
    $checktime = mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y")); // 시간지정 
    if($_SESSION['ss_login_time'] && ($_SESSION['ss_login_time'] < $checktime)) { 
        // 페이지를 연 시점이 되어있고, 저장된 시간이 특정시간 이전일때 
        goto_url($g4['bbs_path']."/logout.php",$urlencode); // 강제 로그아웃 
    } else { 
        // 로그인 타임(페이지를 연 시간)이 없거나, 특정시간을 넘기지 않은 경우는 시간재저장 
        $login_time = mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y")); // 현재시간 저장 
        set_session("ss_login_time", $login_time); 
    } 
?> 
2019/03/11 14:14 2019/03/11 14:14
<? 
/////////////////////5분 후 자동 로그아웃 ///////////// 
if($member[mb_id]) 
    $checktime = mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y")); // 시간지정 
    if($_SESSION['ss_login_time'] && ($_SESSION['ss_login_time'] < $checktime)) { 
        // 페이지를 연 시점이 되어있고, 저장된 시간이 특정시간 이전일때 
        goto_url($g4['bbs_path']."/logout.php",$urlencode); // 강제 로그아웃 
    } else { 
        // 로그인 타임(페이지를 연 시간)이 없거나, 특정시간을 넘기지 않은 경우는 시간재저장 
        $login_time = mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y")); // 현재시간 저장 
        set_session("ss_login_time", $login_time); 
    } 
?> 
2019/03/11 14:14 2019/03/11 14:14
http://storefarm.naver.com/main/callback/login?__targetUrl=%2Fmain%2Fsubscription%2Fsubscribe%2F386131&__method=POST&isAdultCheck=false

위 빨간색 부분만 변경해서 사용하면 됩니다.


2019/02/19 15:06 2019/02/19 15:06
그누루트의 shop.config.php 파일에 제일 하단에 추가

//도메인이 www.sigongschool.com 이면 쇼핑몰 루트 인덱스가 작동하도록... 
if($_SERVER['HTTP_HOST'] == "www.sigongschool.com") { 
$default['de_root_index_use'] = 1; 
}
2018/10/08 12:47 2018/10/08 12:47
.htaccess 파일로 계정내에 rewrite를 설정하시면 원하시는 2차도메인으로 연결이 가능합니다.
 
subdomain.my.com  2차도메인을 subdomain 명의 디렉토리로 연결하실 경우 www폴더 하위에 .htaccess파일을 아래와 같이 설정해보시기 바랍니다.
 
==================.htaccess 파일 예=========================
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(subdomain)/
RewriteCond %{HTTP_HOST} ^subdomain\.my\.com [NC]
RewriteRule ^(.*) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.my\.com(.*) /$1/$2 [L]
===========================================================
2018/10/01 13:58 2018/10/01 13:58
8 bit (비트) 1 byte 
1024 byte (바이트) 1 kilobyte 
1024 kilobyte (킬로바이트) 1 megabyte 
1024 megabyte (메가바이트) 1 gigabyte 
1024 gigabyte  (기가바이트) 1 terabyte 
2018/09/27 19:05 2018/09/27 19:05
2017-07을 정규식으로 표현하면  아래와 같이 됩니다.
[0-9]{4}-[0-9]{2}
이때 [ ]사이에 있는 0-9는 0부터 9를 포함한 0,1,2,3,4,5,6,7,8,9중 하나의 문자가 있어야 한다는 뜻이고 
{수}는 그러한 앞의 조건에 맞는 문자가 그 수만큼 연속으로 있어야 한다는 뜻입니다.
그럼 
2017-7을 정규식으로 표현하면
[0-9]{4}-[0-9]{1,2}  
위와 같이 됩니다.
{1,2}는 1~2개 만큼 연속으로 있어야 한다는 뜻입니다. 
2018/09/27 19:02 2018/09/27 19:02
기본 정규식 이해
  정규식(Regular Expression)은 문자열의 패턴을 기술하는 일종의 미니 언어로, 텍스트 처리 작업이 많은 웹 프로그래밍에서는 필수적인 기능이라고 할 수 있다. 루비에서는 정규식 리터럴이 신택스 레벨에서 지원되기 때문에, 정규식의 사용이 무척 편리하다. 루비에서 정규식은 다음과 같은 방법으로 선언된다.
 >> /Perl/
 => /Perl/
 
 정규식은 /.../ 의 형태로 작성되는데, 위의 정규식은 Perl이라는 텍스트를 인식하는 패턴이다. 정규식을 사용하면, 주어진 텍스트의 일부를 치환하는 것이 가능하다.
 >> “Perl is cool. I like Perl!”.sub(/Perl/, “Ruby”)
 => “Ruby is cool. I like Perl!”
 
위의 코드에서 문자열의 sub 메소드는 원래 문자열에서 /Perl/패턴에 일치하는 첫 번째 부분을 Ruby로 치환해 주고 있다. 문자열에서는 패턴이 일치하는 모든 부분을 Ruby로 치환하고 싶다면, gsub 메소드를 사용한다.
 >> “Perl is cool. I like Perl!”.gsub(/Perl/.”Ruby”)
 => “Ruby is cool. I like Ruby!”
 
하나의 정해진 문자열이 아니라 특정 패턴을 인식하는 정규식을 작성하는 것도 가능하다. 다음은 Perl 문자열과 PHP 문자열을 동시에 매칭하는 정규식이다.
 >> /P(erl|HP)/
 => /P(erl|HP)/
 
정규식에서 | 는 or의 의미를 가진다.
 >> “Perl is cool. I like PHP!”.gsub(/P(erl|HP)/, “Ruby”)
 => “Ruby is cool. I like Ruby!”
 
특정 문자 그룹을 매칭하고 싶다면 [...] 패턴을 사용할 수 있다.
 >> “innvation”.sub(/[aeiou]/, “*”)
 => “*nnvotaion”
 >> “innovation”.gsub(/[aeiou]/, “*”)
 => “*nn*v*t**n”
 
[...] 패턴에는 문자의 범위를 사용할 수도 있다.
 >> “The password is 9428.“.gsub(/[0-9]/,”*”)
 => “The password is ****.”
 
[...] 안에서 처 번째로 사용된 문자가 ^라면, 역패턴이 매칭된다.
 >> “I love Seoul!”.gsub(/[^a-zA-Z]/,”*”)
 => “I*love*Seoul*”
 
 
. 는 모든 문자를 매칭하는 패턴이다. . 하나의 문자를 매칭하게 된다.
 >> “Ruby is cool.”.sub(/.ool/,”fun”)
 => “Ruby is fun”
 
특정 패턴이 반복되는 것을 매칭할 때는 + or * 이 사용된다. + 는 특정 패턴이 1회 이상 반복하는 것을 매칭하고, * 는 특정 패턴이 0회 이상 반복하는 것을 매칭한다.
 >> “Ruby is coooool.”.sub(/o+/, “oo”)
 => “Ruby is cool.”
 
만약 하나 이상의 문자가 반복되는 패턴을 인식하려면, 괄호를 사용할 수 있다.
 >> “1001001001888”.sub(/(001)+/, “”)
 => “1888”
 
앞서 설명한 정규식을 조합해서 사용할 수 있다.
 >> “The password is 9428.”.sub(/[0-9]+/,”*”)
 => “The password is *.”
 
정규식이 텍스트의 치환에만 사용되는 것은 아니다. 주어진 문자열이 특정 패턴을 가지고 있는지 아닌지를 테스트하는 것도 정규식의 중요한 용도 중의 하나이다.
>> “A year has 365 days.” =- /[0-9]+/
=> 11
 위에서는 문자열의 =- 연산자를 이용하여 해당 문자열에 숫자가 있는지 없는지를 테스트하고 있다. =- 연산자는 문자열의 몇 번째 인덱스에서 패턴매칭이 일어났는지를 리턴한다. 만약 패턴 매칭에 실패하면 nil이 리턴된다. 루비에서는 nil과 false외의 모든 값은 true로 인식되기 때문에, =- 연산자는 조건문에서 사용될 수 있다.
 
>> if “A year has 365 days.” =- /[0-9]+/
>>      puts “There is a number in the starting!”
>> end
There is a number in the starting!
=> nil
 
=- 연산자로 문자열의 패턴을 인식하는 경우, 괄호를 사용하여 패턴이 매칭된 부분을 읽어들일 수 있다.
  >> if “A year has 365 days.” =- /[0-9]+/
  >>      put $1
  >> end
  365
  => nil
 
 위에서는 /[0-9]+/ 패턴에 매칭된 문자열이 $1 변수에 저장되고 있다. 만약 패턴에서 두 개 이상의 괄호가 사용된다면, 각 괄호에 의해 매칭된 문자열이 차례로 $1, $2, $3, … 변수에 저장된다.
 
  >> if “210.163.138.100” =- /([0-9]+)\. ([0-9]+)\. ([0-9]+)\. ([0-9]+)/
  >>     puts $1
  >>     puts $2
  >>     puts $3
  >>     puts $4
  >> end
 210
 163
 138
 100
 => nil
 
위의 정규식에서 \. 패턴은 실제의 . 문자를 매칭하고 있다.
2018/09/27 19:02 2018/09/27 19:02

조건 값보다 큰 필드의 레코드 값을 수정

 

 

UPDATE 테이블명 SET 필드명 = "바꿀 값" WHERE 필드명 > "조건 값" 

 

 

조건 값을 제외한 모든 레코드 값을 수정

 

 

UPDATE 테이블명 SET 필드명 = "바꿀 값" WHERE 필드명 <> "조건 값" 

 

 

조건에 맞는 두개의 필드를 바꿈

 

 

UPDATE 테이블명 SET 필드명 = "바꿀 값", 필드명2 = "바꿀 값" WHERE 조건들

 

 

필드의 값에 '철수'라는 단어가 포함 되어 있다면 모두 '영희'로 수정

 

 

UPDATE 테이블명 SET 필드명 = REPLACE(필드명, '철수', '영희')

 

 

조건에 맞는 필드명의 값에 '영희'단어를 덧붙임

 

 

UPDATE 테이블명 SET 필드명 = CONCAT(필드명,'영희') WHERE 조건들

 

 

그누보드 게시판의 여분필드 값을 바꾸는 예제를 해보도록 하겠습니다.

 

Example.01 

게시물 번호 wr_id가 3인 게시물의 wr_subject(제목)과 wr_content(내용)을 변경하는 예제입니다.

 

 

UPDATE g5_write_게시판아이디 SET wr_subject="제목변경", wr_content="내용변경" WHERE wr_id = 3;

2018/08/19 10:58 2018/08/19 10:58
Xpenology(헤놀로지=시놀로지) 설치 방법 정리 합니다.

가정이나 회사에서 사용하지 않는 PC를 이용해 Xpenology(헤놀로지 = 시놀로지) 를 구성할수 있습니다.

준비물

01. osfmount_32bit.zip / osfmount_64bit.zip  [ 부트 커널을 수정하기 위한 OSFMount 프로그램 입니다.]


02. Win32DiskImager.zip [ USB 메모리에 부트 이미지를 기록하기 위한 Win32 Disk Imager 프로그램 입니다.]
03. juns-mod-1.02b-ds3615.zip [ 부팅에 필요한 부트이미지 ]


04. DSM_DS3615xs_15217.zip [ Xpenology(헤놀로지=시놀로지) 설치 파일 입니다.]
05. usbview.zip [ 부팅 USB에 VID와PID 정보를 알아내기 위한 프로그램 입니다.]

------------------------------작업 추가중----------------------------
동영상이든 작업해서 올리도록 하겠습니다.
2018/08/15 00:46 2018/08/15 00:46
<a href="https://네이버톡톡 주소" target="_blank" class="n_talk"><b>네이버톡톡</b></a>

위 내용 넣는곳 .. 
-----------------------------------------------------------------------------

수정 파일 : js/common.js

/**
 * 포인트 창
 **/
var win_point = function(href) {
    var new_win = window.open(href, 'win_point', 'left=100,top=100,width=600, height=600, scrollbars=1');
    new_win.focus();
}
위 내용을 찾은 후 바로 아래에 이렇게 추가


/**네이버 톡톡 새창**/
var n_talk= function(href) {
    var new_win = window.open(href, 'n_talk', 'left=100,top=100,width=600,height=700,scrollbars=1');
    new_win.focus();
}

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

같은 파일에서 좀 더 아랫부분에 있는
 
    $(".win_point").click(function() {
        win_point(this.href);
        return false;
    });
 
여기 바로에 이렇게 추가



추가

    $(".n_talk").click(function() {
        n_talk(this.href);
        return false;
    });



2018/08/14 22:42 2018/08/14 22:42
1. 멤버만 출력

<?php if ($is_member) { ?>
내용
<?php } ?>


2. 관리자만 출력

<?php if ($is_admin) { ?>
내용
<?php } ?>

3. 모바일 내용과 PC 내용 분리

<?php if(G5_IS_MOBILE) {?>
모바일 내용
<?php } ?>
<?php if(!G5_IS_MOBILE) {?>
피씨내용
<?php } ?>

<? if($is_mobile){?> 
모바일 일때 
<? }else{ ?> 
피시일때 
<? } ?>





2018/08/13 13:23 2018/08/13 13:23
이미지의 비포 애퍼터를  구현할때 편하고 아주 맘에 드는 플로그인 입니다.

사용자 삽입 이미지

데모 : https://youngsam.net/PHP/01/twentytwenty-master/index.html

위 데모를 보시면 됩니다 사용범도 간단합니다.


상단에 
<link href = "css / twentytwenty.css"rel = "stylesheet"type = "text / css"/>
<script type = "text / javascript"src = "js / jquery.js"> </ script>
<script type = "text / javascript"src = "js / jquery.event.move.js"> </ script>
<script type = "text / javascript"src = "js / jquery.twentytwenty.js"> </ script>
<script type = "text / javascript">
	$ (window) .load (function () {
		$ ( '. container'). twentytwenty ({ default_offset_pct : 0.5 });
	});
</ script>
지정해주고 .. 표현 하고 싶은곳에  아래 소스

id='container1' class='twentytwenty-container'>
  <img src='sample-before.png'>
  <img src='sample-after.png'>
</div>
원본 링크 : https://zurb.com/playground/twentytwenty

Name Default Value
$pluginPrefix twentytwenty
$twenty20-handle-color #fff
$twenty20-handle-stroke 3px
$twenty20-handle-circle-width 38px
$twenty20-handle-box-shadow 0px 0px 12px rgba(#333,0.5)
$twenty20-handle-triangle-color $twenty20-handle-color
$twenty20-handle-triangle-size 6px
$twenty20-handle-triangle-position 5px
$twenty20-handle-radius 1000px
$twenty20-overlay-bg rgba(#000,0.5)
$twenty20-overlay-label-color #fff
$twenty20-overlay-label-bg rgba(#fff, .2)
$twenty20-overlay-label-height 38px
$twenty20-overlay-label-padding 20px
$twenty20-overlay-label-font-size 13px
$twenty20-overlay-label-letter-spacing 0.1em
$twenty20-label-radius 2px
2018/08/11 20:49 2018/08/11 20:49
데모 : https://youngsam.net//PHP/N/naver_shop.php

파일명 :naver_shop.php

================================================


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="nofollow" target="_blank"> 
​ 
    <meta charset="UTF-8"> 
    
        <div class="container" > 
<div class="row" style="padding:20px;"> 
<div class="panel panel-default"> 
  <div class="panel-heading"><h3><b>네이버쇼핑 검색</b></h3></div> 
  <div class="panel-body"> 
<form action="naver_shop_data.php" method="post"> 
<div class="col-lg-6"> 
    <div class="input-group"> 
      <input type="text" class="form-control" type="text" name="aa" required placeholder="[나노엔] 이라고 검색"> 
      <span class="input-group-btn"> 
        <button type="submit" class="btn btn-default">검색</button> 
      </span> 
    </div> 
</div> 
</form>  
 </div> 
 </div> 
 </div> 
 </div>



파일명 : naver_shop_data.php

================================================
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> 
  
    <meta charset="UTF-8"> 
    
    <script type="text/javascript"> 
  function goBack(){ 
      window.history.back(); 
  } 
</script> 
    
        <div class="container" > 
<div class="row" style="padding:20px;"> 
<button type="submit" class="btn btn-default" value="다시검색" onclick="goBack();" >다시검색</button> 
<p> 
<?php 
@header("Cache-Control:no-cache, must-revalidate"); 
@header("Content-Type: text/html; charset=utf-8"); 
class NaverProxy { 
  public function queryNaver($query, $target) { 
  $client_id = "client_id  값 넣기"; 
  $client_secret = "client_secret 값 넣기"; 
 $query=urlencode($_POST['aa']); 
 $target="shop"; 
 $url = "https://openapi.naver.com/v1/search/shop.xml"; 
 $url = sprintf("%s?query=%s&display=50&start=1&sort=sim&target=shop", $url, $query); 
 $is_post = true; 
 $ch = curl_init(); 
 curl_setopt($ch, CURLOPT_URL, $url); 
// curl_setopt($ch, CURLOPT_GET, $is_post); 
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
 $headers = array(); 
 $headers[] = "X-Naver-Client-Id: ".$client_id; 
 $headers[] = "X-Naver-Client-Secret: ".$client_secret; 
 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
 $data = curl_exec ($ch); 
 curl_close ($ch); 
 return $data; 
  } 
$naverproxy = new NaverProxy(); 
// XML파일에서 원하는 항목만 추출하기 http://search.naver.comNaver Search ResultThu, 25 Jan 2018 13:05:39 +09001764410110 
//echo $naverproxy -> queryNaver($_POST['query'], $_POST['target']); 
$xmlstring = $naverproxy -> queryNaver($_POST['query'], $_POST['target']); 
$xml = simplexml_load_string($xmlstring) or die("에러: 객체를 생성할 수 없습니다"); 
$items = $xml->channel->item; 
if(!empty($items)){ 
foreach($items as $item){  
    echo ' 
    <div class="panel panel-default"> 
  <div class="panel-heading"><h3><b><a href="' . $item->link . '" target="_blank">'. $item->title . ' </a></b></h3></div> 
  <br> 
  <div class="row"> 
  <div class="col-md-4" style="text-align: center;"> <a href="' . $item->link . '" target="_blank"><img src='. $item->image . ' width="200px" height="200px" /></a></div> 
  <div class="col-md-8"> <h4>쇼핑몰: <a href="' . $item->link . '">'.$item->mallName. '</a></h4> 
      <!--<h4>아이디: '. $item->productId . '</h4>--> 
      <h4>최저가: '. $item->lprice. '원</h4> 
      <h4>상품ID: '. $item->productId. '</h4> 
      <h4>가격: '. $item->lprice. '원</h4> 
      </div> 
</div> 
              <br> 
              </div> 
              '      
      ; 
                      
?> 
<button type="submit" class="btn btn-default" value="다시검색" onclick="goBack();" >다시검색</button> 
  </div> 
</div>



2018/08/07 14:14 2018/08/07 14:14
사진슬라이더 네비게이션 등 다양한 효과 소스 모음
http://idangero.us/swiper/demos/

이쁜 체크박스 소스
2018/08/07 13:14 2018/08/07 13:14
윈도우에서 리눅스로 또는 그 반대로 파일을 복사해야 하는 경우가 있습니다. 저는 PC 에 리눅스 특정 폴더를 스크립트 하여 원하는 시간에 백업 하도록 설정 하였습니다. 

이럴경우 필요한 프로그램이 있습니다 PSCP 입니다 PSCP는 윈도우와 리눅스 간에 파일을 복사 할수 있습니다. 

먼저 PSCP.EXE 파일을 다운 받습니다. 

이후 pscp.exe 실행 파일을 system32 디렉토리로 복사합니다. 

일반적으로 C : \ Windows \ System32 경로에 있습니다. 이렇게 하는 이유는 어떤 경로에서도 pscp 명령어를 사용하기 위해서 입니다.

다음 명령어 형식을 사용하십시오.

cmd 스크립트 입니다.


pscp -pw password C:\Users\Admin\Desktop\test.txt  \
user@192.168.33.10:/home/youngsam 


pscp -i /path/to/key.ppk C:\Users\Admin\Desktop\test.txt \
user@192.168.33.10:/home/youngsam

위의 명령은 리눅스에서 윈도우 폴더로 복사하는 명령어 입니다.
2018/08/04 15:26 2018/08/04 15:26
가끔 배열을 사용하다보면 기존배열의 중간이나 특정 사이에 값을 제거해야 할 경우가 생깁니다.
그럴경우에는 아래의 함수를 이용해서 원하는 값을 제거 할 수 있습니다.

<?php
// 배열, 삭제할 값
function arr_del($list_arr, $del_num) {
$key = array_search($del_num, $list_arr); //배열에 키를 알아오고
array_splice($list_arr, $key, 1); // 배열에서 위에서 받아온 키를 삭제
return $list_arr;
}
$arr = array('AAA','BBB','CCC','DDD','EEE');
$result_arr = arr_del($arr, 'CCC'); // 해당 배열에서 CCC를 제거
print_r($result_arr);
?>

결과 

Array ( [0] => AAA [1] => BBB [2] => DDD [3] => EEE )
2018/08/03 19:31 2018/08/03 19:31
<?php
function get_sub_domain(){
preg_match("/(([a-z0-9\-]+\.)*)([a-z0-9\-]+)\.([a-z]{3,4}|[a-z]{2,3}\.[a-z]{2})(\:[0-9]+)?$/", $_SERVER['HTTP_HOST'], $matches);
$sub_domain = null;
if($matches[1]) {
$sub_domain = substr($matches[1], 0, -1);
}
return $sub_domain;
}
?>
2018/08/03 19:30 2018/08/03 19:30
파일질라를 삭제하고 새로 설치 하게 될 경우 기존의 연결 된 FTP의 정보들을 백업해서
새로 설치한 파일질라에 그대로 가져와서 사용할 수 있습니다.
백업 방법은 아주 간단합니다. 아래와 같이 파일질라에서 파일->내보내기 메뉴를 이용해서 가능합니다.

1.
사용자 삽입 이미지

2. 
사용자 삽입 이미지

3. 
사용자 삽입 이미지

복원 방법도 마찬가지로 파일질라의 파일->가져오기 메뉴를 이용해서 백업한 설정 정보를 가져올 수 있습니다.


4. 
사용자 삽입 이미지
5.
사용자 삽입 이미지

위와 같이 기존 설정을 내보내기, 가져오기 기능을 사용하면
이전에 사용하던 FTP의 정보와 개인설정까지 모두 그대로 사용할 수 있습니다.
2018/08/03 19:21 2018/08/03 19:21
<?php
// 도메인 정보를 확인 할때 www를 제외하고 체크하자.
function get_server_name() {
    return preg_replace('/^(www\.)/',"",$_SERVER['SERVER_NAME']);
}
$current_server_name = get_server_name();
echo $current_server_name;
?>
2018/08/03 19:16 2018/08/03 19:16
php에서는 html을 파싱하기 위해서 simple_html_dom 플러그인을 많이 사용되고 있습니다.
그러나 simple_html_dom을 이용하여 파싱을 할수 없거나 자바스크립트로 인해 원하는 결과를 얻어 올수 없을때가 있습니다. 
이럴때 curl 을 이용한 파싱이 도움이 됩니다. 
$url = "http://www.example.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
echo $output;
2018/08/03 12:00 2018/08/03 12:00
var divideHangulPhoneme = function(){
  return {
    "arr_1st":['ㄱ','ㄲ','ㄴ','ㄷ','ㄸ','ㄹ','ㅁ','ㅂ','ㅃ','ㅅ','ㅆ','ㅇ','ㅈ','ㅉ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ'], //초성 19개
    "arr_2nd":['ㅏ','ㅐ','ㅑ','ㅒ','ㅓ','ㅔ','ㅕ','ㅖ','ㅗ','ㅘ','ㅙ','ㅚ','ㅛ','ㅜ','ㅝ','ㅞ','ㅟ','ㅠ','ㅡ','ㅢ','ㅣ'],//중성 21개
    "arr_3th":['','ㄱ','ㄲ','ㄳ','ㄴ','ㄵ','ㄶ','ㄷ','ㄹ','ㄺ','ㄻ','ㄼ','ㄽ','ㄾ','ㄿ','ㅀ',
                'ㅁ','ㅂ','ㅄ','ㅅ','ㅆ','ㅇ','ㅈ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ'],//종성 28개
    "char_st":44032, //'가'의 유니코드 넘버(10진수)
    "char_ed":55203, //'힝'의 유니코드 넘버(10진수)
    /**
     * 문자열을 음소로 나눈 배열로 변환
     * @param  {[type]} str [description]
     * @return {[type]}        [description]
     */
    "divide":function(str){
      var r = null,char=null;
      var res = []
      for(var i=0,m=str.length;i<m;i++){
        char = str.charAt(i);
        r = this.divideCharToPhoneme(char);
        res.push(r?r:char);
      }
      return res;
    },
    /**
     * 문자에서 음소 알아내기
     * @param  {[type]} char [description]
     * @return {[type]}      [description]
     */
    "divideCharToPhoneme":function(char){
      var poses = this.divideCharToPos(char);
      if(!poses){
        return false;
      }
      return [this.arr_1st[poses[0]],this.arr_2nd[poses[1]],this.arr_3th[poses[2]]];
    },
    /**
     * 문자에서 음소 위치 알아내기
     * @param  {[type]} char [description]
     * @return {[type]}      [description]
     */
    "divideCharToPos":function(char){
      if(char.length>2){char=char.charAt(0);}
      var uniNum = char.charCodeAt(0);
      if(uniNum < this.char_st || uniNum > this.char_ed) return false;//한글이 아니다
      var uniNum2 = uniNum-this.char_st;
      var arr_1st_pos = Math.floor(uniNum2/588);
      uniNum2 = uniNum2%588;
      var arr_2nd_pos = (Math.floor(uniNum2/28));
      uniNum2 = (uniNum2%28);
      var arr_3th_pos = uniNum2;
      return [arr_1st_pos,arr_2nd_pos,arr_3th_pos];   
    }
  }
 
}();
 
try{
  module.exports = divideHangulPhoneme;
}catch(e){}
2018/08/03 11:50 2018/08/03 11:50
<script>
// 연산자의 연산 우선순위
function getOpPrec(op) 
    switch (op)
    {
        case '*':
        case '/':
            return 5;
        case '+':
        case '-':
            return 3;    
        case '(': 
            return 1;    
    }
    return -1;
}
// 연산자의 우선순위 비교
function whoPrecOp(op1, op2) 
{
    return getOpPrec(op1) >= getOpPrec(op2);    // op1의 연산순위가 높거나 같다면 참
}
function postfixNotation(exp) 
{  
    var stack = [], convExp = [], tok, popOp; 
    exp = exp.replace(/\s/g, '').match(/[\d\.]+|[^\d\.]/g).reverse();  // 공백제거 및  배열로 분리
    while (tok = exp.pop()) {    
        // 숫자가 아니라면(연산자라면) 
        if (isNaN(tok)) {    
            switch (tok)
            {
                case '(':
                    stack.push(tok);
                    break;
                case ')':
                    while (1) {
                        popOp = stack.pop();
                        if ( popOp == '(' )
                            break;
                        convExp.push(popOp);
                    }
                    break;
                case '+': case '-':
                case '*': case '/':
                    while (stack.length && whoPrecOp(stack[stack.length-1], tok))
                        convExp.push(stack.pop());
                    stack.push(tok);
                    break;
            }
        } else     // 숫자라면(피연산자라면)
            convExp.push(tok); 
    }          
    while (stack.length)  
        convExp.push(stack.pop());    
    return convExp;  
}
function evalPostfixNotation(exp) 
{
    var i, tok, n1, n2, stack = [];
    for (i in exp) {   
        tok = exp[i];
        // 연산자라면 
        if (isNaN(tok)) {
            n2 = Number(stack.pop());
            n1 = Number(stack.pop());
            switch (tok)
            {
                case '*':
                    stack.push(n1 * n2);
                    break;
                case '/':
                    stack.push(n1 / n2);
                    break;
                case '+':
                    stack.push(n1 + n2);
                    break;
                case '-':
                    stack.push(n1 - n2);
                    break;
            }
        } else     // 숫자라면            
            stack.push(tok);
    } 
    return stack.pop();
}
document.write( evalPostfixNotation(postfixNotation( '((3.5 - 2) + 3.4) * (14 - 10)' )));
</script>
2018/08/03 11:47 2018/08/03 11:47
https://spam.kisa.or.kr/integration/main.do

화이트 도메인설정하고
실시간 스팸 차단 리스트
메일 보내기 허용할때 다음 사이트에서 설정해주시면 됩니다.
2018/08/03 11:46 2018/08/03 11:46
//페이지 이동
function go($move = "back",$time = "0") {
    if($move == "back") echo("<script>history.back();</script>");
    else echo("<meta http-equiv='refresh' content='$time;url=$move'>");
}
//메시지창+히스토리백
function alert($message,$move = "back") {
    $print = "<script>window.alert('$message');";
    if($move == "back") $print .= "history.back();";
    else $print .= "location.href = '$move';";
    $print .= "</script>";
    echo("$print");
    exit;
}
//디비접속
function db() {
    global $connect;
    if(!$connect) {
        $connect = mysql_connect("localhost","testid","1234") or die("MySQL 접속 실패");
        mysql_select_db("testdb",$connect) or die("MySQL 접속 실패");
    }
}
//단어 필터링
function filter($string,$filter = "",$type = "change",$change = "###") {
    if(!$filter) return $string;
    $filter = explode(",",$filter);
    $fcount = sizeof($filter);
    for($i = 0;$i < $fcount;$i++) {
        if(eregi($filter[$i],$string)) {
            if($type == "error") alert("\"$filter[$i]\"은(는) 금칙어입니다.");
            else $string = str_replace($filter[$i],$change,$string);
        }
    }
    return $string;
}
//문자열 커트
function cutstr($str,$size) {
    if(!$size or (strlen($str) <= $size)) return $str;
    else for($i = 0;$i < $size;$i++) if(ord($str[$i]) > 127) $over++;
    return chop(substr($str,0,$size - $over%2))."...";
}
//테이블 생성여부 체크
function tablecheck($table,$db)
    $result = mysql_list_tables($db);
    for($i = 0;$i < mysql_num_rows($result);$i++) {
        if($table == mysql_tablename($result,$i)) return true;
    }
    return false;
}
//빠른 DB자료 로드(노가다 도우미;;)
function select($table,$field = "*",$where = "") {
    if(!$table) return false;
    $q = "select $field from $table";
    if($where) $q .= " where $where";
    $result = mysql_query($q);
    $return = mysql_fetch_array($result);
    return $return;
}
//////////아래는 제로보드 lib.php에서 발췌한 함수입니다.
// 빈문자열 경우 1을 리턴
function isblank($str) {
    $temp=str_replace(" ","",$str);
    $temp=str_replace("\n","",$temp);
    $temp=strip_tags($temp);
    $temp=str_replace(" ","",$temp);
    $temp=str_replace(" ","",$temp);
    if(eregi("[^[:space:]]",$temp)) return 0;
    return 1;
}
// 숫자일 경우 1을 리턴
function isnum($str) {
    if(eregi("[^0-9]",$str)) return 0;
    return 1;
}
// 숫자, 영문자 일경우 1을 리턴
function isalNum($str) {
    if(eregi("[^0-9a-zA-Z\_]",$str)) return 0;
    return 1;
}
// HTML Tag를 제거하는 함수
function del_html( $str ) {
    $str = str_replace( ">", ">",$str );
    $str = str_replace( "<", "<",$str );
    return $str;
}
// 주민등록번호 검사
function check_jumin($jumin) {
    $weight = '234567892345'; // 자리수 weight 지정
    $len = strlen($jumin);
    $sum = 0;
    if ($len <> 13) return false;
    for ($i = 0; $i < 12; $i++) {
        $sum = $sum + (substr($jumin,$i,1)*substr($weight,$i,1));
    }
    $rst = $sum%11;
    $result = 11 - $rst;
    if ($result == 10) $result = 0;
    else if ($result == 11) $result = 1;
    $ju13 = substr($jumin,12,1);
    if ($result <> $ju13) return false;
    return true;
}
// E-mail 주소가 올바른지 검사
function ismail( $str ) {
    if( eregi("([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)", $str) ) return $str;
    else return '';
}
// E-mail 의 MX를 검색하여 실제 존재하는 메일인지 검사
function mail_mx_check($email) {
    if(!ismail($email)) return false;
    list($user, $host) = explode("@", $email);
    if (checkdnsrr($host, "MX") or checkdnsrr($host, "A")) return true;
    else return false;
}
// 홈페이지 주소가 올바른지 검사
function isHomepage( $str ) {
    if(eregi("^http://([a-z0-9\_\-\./~@?=&-\#{5,}]+)", $str)) return $str;
    else return '';
}
// URL, Mail을 자동으로 체크하여 링크만듬
function autolink($str) {
    // URL 치환
    $homepage_pattern = "/([^\"\'\=\>])(mms|http|HTTP|ftp|FTP|telnet|TELNET)\:\/\/(.[^ \n\<\"\']+)/";
    $str = preg_replace($homepage_pattern,"\\1<a href=\\2://\\3 target=_blank>\\2://\\3</a>", " ".$str);
    // 메일 치환
    $email_pattern = "/([ \n]+)([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/";
    $str = preg_replace($email_pattern,"\\1<a href=mailto:\\2@\\3>\\2@\\3</a>", " ".$str);
    return $str;
}
// 파일 사이즈를 kb, mb에 맞추어서 변환해서 리턴
function getfilesize($size) {
    if(!$size) return "0 Byte";
    if($size<1024) {
        return ($size." Byte");
    } elseif($size >1024 && $size< 1024 *1024)  {
        return sprintf("%0.1f KB",$size / 1024);
    }
    else return sprintf("%0.2f MB",$size / (1024*1024));
}
2018/08/03 11:45 2018/08/03 11:45
<?php // 모바일 PC 확인  함수 추가
function MobileCheck() { 
    global $HTTP_USER_AGENT; 
    $MobileArray  = array("iphone","lgtelecom","skt","mobile","samsung","nokia","blackberry","android","android","sony","phone");
    $checkCount = 0; 
        for($i=0; $i<sizeof($MobileArray); $i++){ 
            if(preg_match("/$MobileArray[$i]/", strtolower($HTTP_USER_AGENT))){ $checkCount++; break; } 
        } 
   return ($checkCount >= 1) ? "Mobile" : "Computer"; 
}
?>


<?php if(MobileCheck() != "Mobile"){ // 모바일 PC 함수 사용?>
<?php
      include 'a.php';
    ?>
<?php } ?>

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

!=  / ==

수정하면 변경 할수 있습니다. 
2018/08/03 11:44 2018/08/03 11:44
PHP 내장함수

<?php
$rest = substr("abcdef", 0, -1);  // returns "abcde"
$rest = substr("abcdef", 2, -1);  // returns "cde"
$rest = substr("abcdef", 4, -4);  // returns false
$rest = substr("abcdef", -3, -1); // returns "de"
?>
2018/08/03 11:40 2018/08/03 11:40