웹마스터 팁

우선 $HTTP_REFERER를 이용하므로 새창으로 띄우면 안됩니다-_-ㆀ

아..그리고 이름을 좀 바꿨어요-_- bookmark에서 clipping으로;;;

회원정보 중 $member[no]를 이용합니다..
id보단 편하지 않나요;; 중복염려 제로(id도 마찬가진가...)에....글자수도 적구...ㅡㅡ;;
NZEO사이트도 그런식인거같은데;;;
그리구 NZEO사이트와 똑같이 20개이상은 안돼게 해놨어요...

NZEO와 같은 셀렉트 박스를 이용하려면...우선 제로님의 zSelectBox.js파일받아서 페이지에 넣어주시구
아래와 같이 넣어주세요...(아웃로긴 포함된페이지에 한함...;; 안그럼 outlogin.php를 먼저 인클루드해주세요-_-)
여기에 쓰인 이미지는.....삭제시켜버려서..ㅠ_ㅜ

이상한 부분이나 안돼시는 부분 지적해주세요......-_-
제가 초보라 잘모르지만 지적해주시면 고치도록 노력해볼게요..;;
저같은 경우전 잘되기땜에 별문제는 없을거라 생각됩니다만.....ㅡㅡ;

/////////// 여기서부터 인클루드 시킬부분... //////////////////////////////////////////////////
<?
                if(!$member[no]) {
?>
                                <td rowspan=2><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></td><td rowspan=2 width=67 height=23></td>
                        </tr>
                        <tr>
                                <td width=101 height=19>
                                                <script>
                                                        var selectBox = new Array();
                                                        var option = new Array();
                                                        selectBox["id"] = "BookMark";
                                                                selectBox["fontsize"] = "9";
                                                                selectBox["width"] = "101";
                                                                selectBox["height"] = "19";
                                                                selectBox["fontcolor"] = "#333333";
                                                                selectBox["bordercolor"] = "#666666";
                                                                selectBox["focusbgcolor"] = "#e4e4e4";
                                                                selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
                                                                selectBox["padding"] = "0";
                                                                selectBox["onChange"] = true;
                                                                option[0] = "<font class=ineal>로그인 필요...</FONT>";
<?
}
else
{
?>
                                <td rowspan=2><a href="/bbs/clip.php"><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></a></td><td rowspan=2 width=67 height=23></td>
                        </tr>
                        <tr>
                                <td width=101 height=19>
                                                <script>
                                                        var selectBox = new Array();
                                                        var option = new Array();
                                                        selectBox["id"] = "BookMark";
                                                                selectBox["fontsize"] = "9";
                                                                selectBox["width"] = "101";
                                                                selectBox["height"] = "19";
                                                                selectBox["fontcolor"] = "#333333";
                                                                selectBox["bordercolor"] = "#666666";
                                                                selectBox["focusbgcolor"] = "#e4e4e4";
                                                                selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
                                                                selectBox["padding"] = "0";
                                                                selectBox["onChange"] = true;
                                                                option[0] = "<font class=ineal>My Clipping...</FONT>";
<?
$result=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total=$temp["count(*)"];

        $num=$total;
        while($data=mysql_fetch_array($result))
        {
        ?>
                                                                option[<?=$num?>] = "<?=$data[name]?>,<?=$data[url]?>";
        <?
        $num--;
        }
}
?>
                                                                option["select"] = 0;
                                                                printZSelectBox(selectBox,option);
                                                        </script>
                                </td>
                        </tr>
                </table>
/////////// 여기까지가 인클루드 시킬부분... //////////////////////////////////////////////////



여기서부터 소스시작~ 제로보드 설치 디렉토리에 넣어주세요...

<?
// 라이브러리 함수 파일 인크루드
        include "lib.php";

// DB 연결
        if(!$connect) $connect=dbConn();

// 멤버정보 구하기
        $member=member_info();
        if(!$member[no]) Error("로그인된 회원만이 사용할수 있습니다");

// 클립보기/등록.
if(!$exec) {
$this_page = "이 페이지(http://를 포함한...)를 적어주세요..";
if($HTTP_REFERER=='$this_page') $HTTP_REFERER="";
$result2=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp2=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total_clip=$temp2["count(*)"];

?>
<HTML>
<HEAD>
<STYLE TYPE="text/css" TITLE="">
P,td,br,BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,blockquote {font-size:9pt;}

BODY {color:#333333;font-family:돋움;
        scrollbar-face-color:#FFFFFF;
        scrollbar-highlight-color: #aaaaaa;
        scrollbar-3dlight-color: #FFFFFF;
        scrollbar-shadow-color: #aaaaaa;
        scrollbar-darkshadow-color: #FFFFFF;
        scrollbar-track-color: #FFFFFF;
        scrollbar-arrow-color: #aaaaaa;
}

img {border:none}

.t  {line-height:140%}
.bold {font-weight:bold}

.bt_s {border:solid 1 black;font-family:verdana;font-size:7pt;font-weight:bold;color:white;background-color:#404040;}
.in_t {border:solid 1;background-color:white;border-color:#404040;line-height:120%}

a:link { text-decoration: none; color: black; font-size: 8pt; }
a:visited { text-decoration: none; color: black; font-size: 8pt; }
a:active { text-decoration: none; color: #4E87FF; font-size: 8pt; }
a:hover {  text-decoration:none; color:#4E87FF; font-size: 8pt; }

.tah7 {font-family:Tahoma,Verdana,Arial;font-size:7pt}
.tah8 {font-family:Tahoma,Verdana,Arial;font-size:8pt}
.tah9 {font-family:Tahoma,Verdana,Arial;font-size:9pt}

</STYLE>
<script>
function clearField(field){ if (field.value == field.defaultValue) { field.value = ""; } }
function checkField(field){ if (field.value == "") { field.value = field.defaultValue; } }

function clip_check_submit(obj) {
        if(!obj.name.value) {
                alert("Clip Name을 입력하세요");
                obj.name.focus();
                return false;
        }
        if(!obj.url.value) {
                alert("URL을 입력하세요");
                obj.url.focus();
                return false;
        }
        return true;
}
</script>
</HEAD>

<table width=100% border=0 cellpadding=0 cellspacing=0>
        <tr>
                <td valign=top height=600 align=center>

<table border='1' width='500' style='border-style:solid;' cellspacing='0' bordercolordark='white' bordercolorlight='black' cellpadding=3>
<tr>
        <td colspan=3 class='f_4 bold tah8'><b>What is 'My Clipping'...?</b></td>
</tr>
<tr>
        <td colspan=3 class='tah8 t' height=35>
        이 사이트 내의 페이지나, 다른 사이트까지 북마크를 하실수 있는 Service입니다.<br>
        최고 20개까지만 북마크를 등록하실수 있기 때문에 아껴서 사용해 주세요.<br>
        더 많이 지원해 드리고 싶지만, DB자원이 한정되어 있어서 어쩔수 없음을 이해해 주시면 감사하겠습니다.
        

        </td>
</tr>

</table>

<br>
<?
if($total_clip>=20) {

        }
        else {
?>
<table border=0 cellspacing=0 cellpadding=3 width=500 >
<col width=80></col><col width=></col>
<form actoin="<?=$PHP_SELF?>" method=post onsubmit="return clip_check_submit(this)">
<input type=hidden name=exec value="insert">
<tr nowrap>
        <td class=tah7 align=right>Clip Name</td>
        <td><input type=input name=name size=20 maxlength=20 class="in_t tah7" onFocus="clearField(this)" onBlur="checkField(this)" value="Clip Name"></td>
</tr>
<tr nowrap>
        <td class=tah7 align=right>URL</td>
        <td><input type=input name=url value="<?=$HTTP_REFERER?>" size=65 maxlength=250 class="in_t tah7"></td>
</tr>
<tr nowrap>
        <td colspan=2 align=center><input type=submit value="Add This Clip" class=bt_s></td>
</tr>
</form>
</table>

<br>
<?
        }
?>

<table border=0 width=500 cellspacing=1 cellpadding=5 style=table-layout:fixed>
<col width=120></col><col width=></col><col width=50></col>
<tr>
        <td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>
<tr align=center>
        <td class=tah7>Name</td>
        <td class=tah7>URL</td>
        <td class=tah7>Del</td>
</tr>
<tr>
        <td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr><?
        $num_clip=$total_clip;
        while($data2=mysql_fetch_array($result2))
        {echo "
<tr class=fixed>
        <td nowrap class='tah8' height=35 align=center><b><!-- $num_clip -->$data2[name]</b></td>
        <td nowrap><a href='$data2[url]'>$data2[url]</a></td>
        <td align=center><a href='$PHP_SELF?exec=delete&no=$data2[no]' onclick="return confirm('삭제하시겠습니까?')"><font style='font:bold 10px Verdana;color:c60000;text-decoration:none'>X</font></a></td>
</tr>
<tr>
        <td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>";
        $num_clip--;
        }
?>
</table>


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

</HTML>
<?
}

// 클립추가
if($exec=="insert") {
        if($total_clip>=20) {
                Error("클립은 20개까지만 저장가능합니다....^^;;");
        }
        else {
                        if(isblank($name)) Error("이름을 입력하셔야 합니다");
                        if(isblank($url)) Error("URL을 입력하셔야 합니다");
                        if($name=="Clip Name") Error("Clip Name을 제대로 입력하셔야 합니다");
                        mysql_query("insert into clip (member_no, name, url) values ('$member[no]','$name','$url')", $connect) or die(mysql_error());
        }
        header("Location: $PHP_SELF");
}

// 클립삭제
if($exec=="delete") {
        mysql_query("DELETE FROM clip WHERE no = '$no' and member_no = '$member[no]'", $connect);
        header("Location: $PHP_SELF");
}
?>
제목 글쓴이 날짜
이미지를 HTML table tag로 변환. [7] file 민이 2002.12.31
국내 IP정보를 조회하는 클래스 [7] 행복한고니 2003.01.04
[동주아빠] PHP 게시판(23강) - 내용 보기 기능(1) view.php 디자인 손병목 2003.01.04
[동주아빠] PHP 게시판(24강) - 내용 보기 기능(2) view.php 소스 file 손병목 2003.01.04
[동주아빠] PHP 게시판(25강) - 내용 보기 기능(3) 설명 [1] 손병목 2003.01.04
access 자료(mdb) 를 MySQL로 변환하는 방법 [8] 황선규 2003.01.06
[1분짜리 팁] 절대경로 알아내기! [14] 찐군 2003.01.09
웹서핑중 구했습니다. 조그만 달력.. [6] file 황선규 2003.01.10
[동주아빠] PHP 게시판(26강) - 수정(modify.php) 손병목 2003.01.11
[동주아빠] PHP 게시판(27강) - 수정(modify_ok.php) 손병목 2003.01.11
[동주아빠] PHP 게시판(28강) - 삭제(delete.php) 손병목 2003.01.11
[동주아빠] PHP 게시판(끝.29강) - 삭제(delete_ok.php) [18] 손병목 2003.01.11
웹 인증 보호, 윈도우 로그인 폼 이용 (authenticate) [9] file 둘리나라™ 2003.01.13
파일 하나로 끝내는-_- NZEO 북마크...-_-a [14] ineal 2003.01.13
텍스트 링크, 배너 링크*랜덤 (틀팁포함) [3] 둘리나라™ 2003.01.16
국내 IP 조회하는 클래스.(소켓사용) [1] 행복한고니 2003.01.17
엔지오 처럼 주소 /?channel=about 식으로 만들기 [18] 위니 2003.01.21
[제로카운터 수정하기#1-초보용] 테이블 다 지우고 새로 설치하기 [2] 김태훈 2003.01.22
[제로카운터 수정하기#2-초보용] 새로 설치후 예전 방문자수로 고치기(최고방문자수 문제해결됨) 김태훈 2003.01.22
[제로카운터 수정하기#3-초보용] 어제 오늘 방문자수 변경하기 김태훈 2003.01.22