board_head 관련 질문입니다.

<?
// 게시판 관리의 상단 파일 경로
if ($board[bo_include_head])
    @include ($board[bo_include_head]);

// 게시판 관리의 상단 이미지 경로
if ($board[bo_image_head])
    echo "<img src='$g4[path]/data/file/$bo_table/$board[bo_image_head]' border='0'>";

// 게시판 관리의 상단 내용
if ($board[bo_content_head])
    echo stripslashes($board[bo_content_head]);
?>

board_head.php의 일반 구문입니다.

위에서 게시판 관리의 상단 내용을 출력하기에 앞서,
bo_content_head에 <font> 속성을 주려고 하는데, 방법을 모르겠네요.

echo "<font color='~~'>stripslashes($board[bo_content_head])</font>";

위와 같은 형태로 설정하면 stripslashes 문구가 함께 출력되네요.

어떻게 설정해야 할까요?

+
또한 stripslashes($board[bo_content_head])에 스크립트 속성을 입힐 수 있는지도 궁금합니다.

|

댓글 2개

문자열 내에 함수호출이 있을 경우에는 . 으로 연결해 주시면 됩니다.

if ($board[bo_content_head])
echo "<font color='red'>".stripslashes($board[bo_content_head])."</font>";


========== javascript 사용할 경우 ==================================
if ($board[bo_content_head]) {
echo "<script type='text/javascript'>";
echo "alert('" . stripslashes($board[bo_content_head])."');";
echo "</script>";
}
==================================================================
답변 감사드립니다. ^^

덕분에 초보로서 좋은 지식 배웠습니다. (__)
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
16년 전 조회 3,353
16년 전 조회 1,411
16년 전 조회 973
16년 전 조회 2,490
16년 전 조회 1,213
16년 전 조회 1,036
16년 전 조회 1,525
16년 전 조회 1,425
16년 전 조회 1,623
16년 전 조회 1,683
16년 전 조회 1,736
16년 전 조회 1,265
16년 전 조회 753
16년 전 조회 969
16년 전 조회 916
16년 전 조회 949
16년 전 조회 1,860
16년 전 조회 1,533
16년 전 조회 1,518
16년 전 조회 960
🐛 버그신고