Skip to content
On this page

그누보드 에디터 사용법

설명 :

위지윅 에디터 사용법

php
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
  
  
$editor_html = editor_html("content", get_text(html_purifier($rows['content']), 0));
  
여기서 스크립트 따로 집어 넣을때..
function frmcontentform_check(f)
{
    <?php echo get_editor_js("content"); ?>
  
   return true;
}

이렇게 하고 나서

백단에서 소스는 이렇게 하면된다.

php
$content = conv_content(conv_unescape_nl(stripslashes($_REQUEST['content'])), 1);

이건 그누 5.4 최신에서 사용된거 같은데 이렇게 하면 p 태그 br 태그가 먹힌다.

그리고 밑에꺼는 포스트 값에 xss 클리어링 하는건데 그냥 알아두면된다

쓸때 마다 밑에꺼로랑 같이 쓰면된다.

여기서 참고로 content 는 넣어서 쓰면 안된다 xss 제거 되서 태그가 안먹힌다.

php
$check_keys = array(
    'num',
    'writer',
    'subject',
    'datetime'
);
  
foreach($check_keys as $key){
    $$key = $_POST[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
}