You cannot see this page without javascript.

PHP print

Programing 조회 수 797 추천 수 0 2013.12.12 14:57:46
■ 첫번째....스킨의 view_foot.php 파일을 열어서 하단 부분 적당한 위치에 (코딩은 알아서 하세요)
    먼저 아래와 같이 프린트 링크용 아이콘이나 링크글자를 넣어주세요.(저는 텍스트로 했습니다)
    물론 본인이 필요한 곳에 넣으셔야죠.

<!-- 프린트하기 -->
<table>
<tr>
<td>
<?=$use_print_start?> <a href="<?=$dir?>/print.php?no=<?=$data[no]?>&id=<?=$id?>" target="_blank" onfocus=blur()><b><font color=blue font size=3>▲ 이페이지 인쇄하기</font></b></a><?=$use_print_end?>
</td>
</tr>
</table>

■ 두번째.....아래의 소스를 print.php 파일로 저장하신 후에 자신의 계정 디렉토리 중
    해당스킨 폴더에 업로드하세요.


<!-- 여기서 부터 print.php 소스 -->
<html>
<head></head>
<title>제목은 알아서 넣으시구요</title>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function printPage() {
window.print();
}
// End -->
</script>

<body OnLoad="printPage()">

<?
// 아래의 데이터접속 정보를 수정하세요
$connect=mysql_connect("localhost","디비아이디","디비비번");
mysql_select_db("디비이름");

$result=mysql_query("select * from zetyx_board_$id where no=$no");
$data=mysql_fetch_array($result);
$memo=nl2br(stripslashes($data[memo]));
$subject=stripslashes($data[subject]);
$filename1 = $data[file_name1];  
$filename2 = $data[file_name2];  
    if(eregi(".gif|.jpg",$filename1))$upload_image1 = "<img src=/bbs/".$filename1." border=0><br><br>"; else $upload_image1="";
    if(eregi(".gif|.jpg",$filename2))$upload_image2 = "<img src=/bbs/".$filename2." border=0><br><br>"; else $upload_image2="";
?>

<table align=center cellspacing=0 cellpadding=5 width=70%>
<tr>
<td bgcolor=#666666 align=left colspan=2>
<font color=white><b>제목 : <?=$subject?></b></font>
</td>
</tr>
<tr>
<td width=50%>
작성자 : <?=$data[name]?>
</td>
<td width=50% align=right>
</td>
</tr>
<tr>
<td>

<!-- 여기서 부터 인쇄내용 보이기 -->
<table border=1 style="border-collapse:collapse;" bgcolor=ffffff bordercolor=slategray cellpadding="0" cellspacing="0" width=100%>
<tr>
<td>

※ 여기에 프린트 될 내용 삽입
   (여기에는 view.php 내용중에 인쇄할 내용만 태그로 작성하셔서 들어가면 됩니다.)

</td>
</tr>
</table>
<!-- 여기까지 인쇄내용 -->

</td>
</tr>
</table>

</body>
</html>

<!-- 여기까지가 print.php 소스입니다. -->

***************************************************************

위와 같이 하시면 쉽게 본문내용(<?=$memo?>) 뿐만 아니라 자신이 원하는 스킨의 내용을
그대로 인쇄하실 수 있습니다.
약간의 수고만 각오를 하신다면.....

물론 스킨의 상황들이 전부 다르다보니 잠시 착오를 일으킬 수도 있으나
자세히 뜯어보시면 아무것도 아닙니다.

스타일이 적용된 페이지를 인쇄하시려다 보면 인쇄 내용이 스타일의 적용을 받아
흐리게 또는변형을 받으실 수 있어서 스타일은 사용하지 않았습니다.
필요하신 분은 스타일을 적용하셔도 무방합니다.
엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

Xpress Engine XE 애드온 --XE 애드온의 기초 이해

  • LynX
  • 2014-07-11
  • 조회 수 845

Windows Windows 10 재작 툴 file [21]

  • LynX
  • 2015-08-19
  • 조회 수 843

Server 웹 동접자 수 확인 코드

  • LynX
  • 2016-09-08
  • 조회 수 842

CentOS apm소스 [9]

  • LynX
  • 2015-05-29
  • 조회 수 837

CentOS7 ▒ Doly의 CentOS7 강좌 9 3. CentOS시작, 종료, 둘러보기 -1 file [12]

  • LynX
  • 2014-10-23
  • 조회 수 816

CentOS Grub UUID change

  • LynX
  • 2018-08-08
  • 조회 수 815

RoundCube 첨부 용량 변경 / 한글 수정 [10]

  • LynX
  • 2012-01-31
  • 조회 수 815

Server 톰켓 설치 file

  • LynX
  • 2014-05-20
  • 조회 수 814

CentOS memchached [1]

  • LynX
  • 2016-04-21
  • 조회 수 813

Network HSRP 구성 file [20]

  • LynX
  • 2015-04-29
  • 조회 수 811

Programing PHP print

  • LynX
  • 2013-12-12
  • 조회 수 797

Linux 리눅스 기본 명령어

  • LynX
  • 2014-07-16
  • 조회 수 794

OpenSolaris Open Solaris 에서 MariaDB 설치 [8]

  • LynX
  • 2014-12-30
  • 조회 수 786

APM phpmyadmin 설정

  • LynX
  • 2013-12-27
  • 조회 수 776

HTML Tag Flowplayer [11]

  • LynX
  • 2013-07-20
  • 조회 수 773

APM httpd.conf 정리

  • LynX
  • 2013-12-27
  • 조회 수 772

HTML Tag JWPlayer 사용법 #1 시작 file [7]

  • LynX
  • 2013-06-25
  • 조회 수 765

Linux Centos 동영상플레이어

  • LynX
  • 2014-06-29
  • 조회 수 758

Linux LFS/Preparation - 준비

  • LynX
  • 2014-08-06
  • 조회 수 748

Linux 커널 컴파일 [10]

  • LynX
  • 2014-12-08
  • 조회 수 747

XE Login