테스트 사이트 - 개발 중인 베타 버전입니다

download.php 채택완료

tonton 8년 전 조회 3,488

// 쿠키에 저장된 ID값과 넘어온 ID값을 비교하여 같지 않을 경우 오류 발생

// 다른곳에서 링크 거는것을 방지하기 위한 코드

if (!get_session('ss_view_'.$bo_table.'_'.$wr_id))

    alert('잘못된 접근입니다.');

 

다른서버에 download.php 주소를 가져오니깐 잘못된 접근이라고 뜨는데

 

다른서버에 session설정 하는법 있을까요?

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
F
8년 전

bbs/board.php파일에서  세션이 없을경우 set_session($ss_name, TRUE); 이런식으로 값을 설정햇네요 

글을 최소한 한번 읽어야 해당글에 대한 세션이 설정되고  다운로드 할수 있게 돼있네요

</strong></pre><pre style="font-family: Consolas; font-size: 10.5pt; background-color: rgb(255, 255, 255);"><pre style="font-family: Consolas; font-size: 10.5pt;"><span style="color: rgb(150, 150, 150);">// </span><span style="color: rgb(150, 150, 150); font-family: 宋体;">한번 읽은글은 브라우저를 닫기전까지는 카운트를 증가시키지 않음
</span><span style="color: rgb(109, 50, 6);">$ss_name </span>= <span style="color: rgb(206, 123, 0);">'ss_view_'</span>.<span style="color: rgb(109, 50, 6);">$bo_table</span>.<span style="color: rgb(206, 123, 0);">'_'</span>.<span style="color: rgb(109, 50, 6);">$wr_id</span>;
<span style="color: rgb(0, 0, 230);">if </span>(!<span style="color: rgb(51, 51, 51);">get_session</span>(<span style="color: rgb(109, 50, 6);">$ss_name</span>))
{
    <span style="color: rgb(51, 51, 51);">sql_query</span>(<span style="color: rgb(206, 123, 0);">" update </span>{<span style="color: rgb(109, 50, 6);">$write_table</span>}<span style="color: rgb(206, 123, 0);"> set wr_hit = wr_hit + 1 where wr_id = '</span>{<span style="color: rgb(109, 50, 6);">$wr_id</span>}<span style="color: rgb(206, 123, 0);">' "</span>);

    <span style="color: rgb(150, 150, 150);">// </span><span style="color: rgb(150, 150, 150); font-family: 宋体;">자신의 글이면 통과
</span><span style="color: rgb(150, 150, 150); font-family: 宋体;">    </span><span style="color: rgb(0, 0, 230);">if </span>(<span style="color: rgb(109, 50, 6);">$write</span>[<span style="color: rgb(206, 123, 0);">'mb_id'</span>] && <span style="color: rgb(109, 50, 6);">$write</span>[<span style="color: rgb(206, 123, 0);">'mb_id'</span>] == <span style="color: rgb(109, 50, 6);">$member</span>[<span style="color: rgb(206, 123, 0);">'mb_id'</span>]) {
        ;
    } <span style="color: rgb(0, 0, 230);">else if </span>(<span style="color: rgb(109, 50, 6);">$is_guest </span>&& <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_read_level'</span>] == <span style="color: rgb(153, 60, 125);">1 </span>&& <span style="color: rgb(109, 50, 6);">$write</span>[<span style="color: rgb(206, 123, 0);">'wr_ip'</span>] == <span style="color: rgb(109, 50, 6);">$_SERVER</span>[<span style="color: rgb(206, 123, 0);">'REMOTE_ADDR'</span>]) {
        <span style="color: rgb(150, 150, 150);">// </span><span style="color: rgb(150, 150, 150); font-family: 宋体;">비회원이면서 읽기레벨이</span><span style="color: rgb(150, 150, 150);"> 1</span><span style="color: rgb(150, 150, 150); font-family: 宋体;">이고 등록된 아이피가 같다면 자신의 글이므로 통과
</span><span style="color: rgb(150, 150, 150); font-family: 宋体;">        </span>;
    } <span style="color: rgb(0, 0, 230);">else </span>{
        <span style="color: rgb(150, 150, 150);">// </span><span style="color: rgb(150, 150, 150); font-family: 宋体;">글읽기 포인트가 설정되어 있다면
</span><span style="color: rgb(150, 150, 150); font-family: 宋体;">        </span><span style="color: rgb(0, 0, 230);">if </span>(<span style="color: rgb(109, 50, 6);">$config</span>[<span style="color: rgb(206, 123, 0);">'cf_use_point'</span>] && <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_read_point'</span>] && <span style="color: rgb(109, 50, 6);">$member</span>[<span style="color: rgb(206, 123, 0);">'mb_point'</span>] + <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_read_point'</span>] < <span style="color: rgb(153, 60, 125);">0</span>)
            <span style="color: rgb(51, 51, 51);">alert</span>(<span style="color: rgb(206, 123, 0);">'</span><span style="color: rgb(206, 123, 0); font-family: 宋体;">보유하신 포인트</span><span style="color: rgb(206, 123, 0);">('</span>.<span style="color: rgb(0, 134, 179);">number_format</span>(<span style="color: rgb(109, 50, 6);">$member</span>[<span style="color: rgb(206, 123, 0);">'mb_point'</span>]).<span style="color: rgb(206, 123, 0);">')</span><span style="color: rgb(206, 123, 0); font-family: 宋体;">가 없거나 모자라서 글읽기</span><span style="color: rgb(206, 123, 0);">('</span>.<span style="color: rgb(0, 134, 179);">number_format</span>(<span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_read_point'</span>]).<span style="color: rgb(206, 123, 0);">')</span><span style="color: rgb(206, 123, 0); font-family: 宋体;">가 불가합니다</span><span style="color: rgb(206, 123, 0);">.</span><span style="color: rgb(221, 17, 68);">\\</span><span style="color: rgb(206, 123, 0);">n</span><span style="color: rgb(221, 17, 68);">\\</span><span style="color: rgb(206, 123, 0);">n</span><span style="color: rgb(206, 123, 0); font-family: 宋体;">포인트를 모으신 후 다시 글읽기 해 주십시오</span><span style="color: rgb(206, 123, 0);">.'</span>);

        <span style="color: rgb(51, 51, 51);">insert_point</span>(<span style="color: rgb(109, 50, 6);">$member</span>[<span style="color: rgb(206, 123, 0);">'mb_id'</span>], <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_read_point'</span>], ((<span style="color: rgb(51, 51, 51);">G5_IS_MOBILE </span>&& <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_mobile_subject'</span>]) ? <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_mobile_subject'</span>] : <span style="color: rgb(109, 50, 6);">$board</span>[<span style="color: rgb(206, 123, 0);">'bo_subject'</span>]).<span style="color: rgb(206, 123, 0);">' '</span>.<span style="color: rgb(109, 50, 6);">$wr_id</span>.<span style="color: rgb(206, 123, 0);">' </span><span style="color: rgb(206, 123, 0); font-family: 宋体;">글읽기</span><span style="color: rgb(206, 123, 0);">'</span>, <span style="color: rgb(109, 50, 6);">$bo_table</span>, <span style="color: rgb(109, 50, 6);">$wr_id</span>, <span style="color: rgb(206, 123, 0);">'</span><span style="color: rgb(206, 123, 0); font-family: 宋体;">읽기</span><span style="color: rgb(206, 123, 0);">'</span>);
    }

    <span style="color: rgb(51, 51, 51);">set_session</span>(<span style="color: rgb(109, 50, 6);">$ss_name</span>, <span style="color: rgb(0, 0, 230);">TRUE</span>);
}</pre></pre><pre style="font-family: Consolas; font-size: 10.5pt; background-color: rgb(255, 255, 255);"><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal; white-space: normal;">
 
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인