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

jump기능에 대한 처리 문의드립니다. 최종 db Update가 안되어서~~ 채택완료

더블피디 9년 전 조회 3,416

 


view.skin.php 에 위와 같이 수정, 삭제...버튼 앞에 점프 버튼을 달았습니다.

/skin/board/jump/view.skin.php

 

 </o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""><ul
class="bo_v_com"></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""><li><button
class="btn_submit" id="<span style="color: rgb(255, 255, 255); background-color: rgb(255, 0, 0);">goJump</span>"></span><span style="font-size:9.0pt;mso-ascii-font-family:"Courier New";mso-hansi-font-family:
"Courier New";mso-bidi-font-family:"Courier New"">점프</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""></button></li></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""><?php if ($update_href) {
?><li><a href="<?php echo $update_href ?>"
class="btn_b01"></span><span style="font-size:9.0pt;mso-ascii-font-family:
"Courier New";mso-hansi-font-family:"Courier New";mso-bidi-font-family:"Courier New"">수정</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""></a></li><?php
} ?><o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""><span style="mso-spacerun:yes">       ...중간 생략 ....</span></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""><li><a href="<?php
echo $list_href ?>" class="btn_b01"></span><span style="font-size:9.0pt;mso-ascii-font-family:"Courier New";mso-hansi-font-family:
"Courier New";mso-bidi-font-family:"Courier New"">목록</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""></a></li></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""></ul></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"><script></span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">$(function()
{</span></p><p class="MsoNormal"><span lang="EN-US" style="text-indent: 40pt; font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span></p><p class="MsoNormal"><span lang="EN-US" style="text-indent: 40pt; font-size: 10pt; font-family: 나눔고딕, NanumGothic;">// </span><span style="text-indent: 40pt; font-size: 10pt; font-family: 나눔고딕, NanumGothic;">상품점프</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">$("#</span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5; color: rgb(255, 255, 255); background-color: rgb(255, 0, 0);">goJump</span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">").click(function() {</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">  var totaljumotoday =
"<?=$view['wr_7']?>";</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">   if(totaljumotoday > 4) { </span><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">alert('</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">금일</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">점프</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">허용횟수초과되었습니다</span><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">.');  </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">return false; </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">}</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">    if(confirm("</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">맨</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">앞으로</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">출근부</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">점프를</span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"> </span><span style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">진행하시겠습니까</span><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;">? " )) {</span> </p><p class="MsoNormal"><span lang="EN-US"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt;">            </span><font color="#ff0000" face="나눔고딕, NanumGothic"><span style="font-size: 10pt;">var data = 'mode=</span><span style="font-size: 13.3333px;">goJump</span><span style="font-size: 10pt;">&wr_id=<?php
echo $</span></font><span style="color: rgb(255, 0, 0); font-family: 나눔고딕, NanumGothic; font-size: 13.3333px; line-height: 20px;">checkcode</span><font color="#ff0000" face="나눔고딕, NanumGothic"><span style="font-size: 10pt;"> ?>&wr_8=<?php echo $view['wr_8'] ?>';</span></font><font face="나눔고딕, NanumGothic"><span style="font-size: 10pt;"><o:p></o:p></span></font></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 나눔고딕, NanumGothic;"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt;">              </span>$.ajax ({</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                type :"POST",</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                url    :</span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5; color: rgb(255, 255, 255); background-color: rgb(109, 48, 207);">"<? echo G5_URL
?>/exec.php"</span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">,</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                data :data,</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                success:function(html) { </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">$("#jumpgood").hide(); </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">},</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                error: function(xhr, option,
error){ </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">alert(xhr.status); </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">alert(error); </span><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">}</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">                });</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">     }</span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;">  } </span></p><p class="MsoNormal"><span style="font-family: 나눔고딕, NanumGothic; font-size: 10pt; line-height: 1.5;"></script></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt">

 

 

/exec.php

 </o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">if($_POST['mode'] == "goJump") {<o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"> </p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">       $wr_id = $_POST[checkcode];<o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">       $wr_8  = explode("
",$_POST['wr_8']);<o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">       $today = date("Y-m-d");</span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span style="font-size: 9pt; line-height: 16.5pt;">       </span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">       if($today == $wr_8[0]) { //</span><span style="font-size:9.0pt;font-family:돋움;color:black">오늘 날짜와<span lang="EN-US"> db </span>수정
날짜가 같으면<span lang="EN-US"><o:p></o:p></span></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">            </span><span style="font-size: 9pt; line-height: 16.5pt;">alert(' AAA 실행 되었습니다.'); </span></p><p style="margin: 0cm 0cm 0.0001pt 40px; line-height: 16.5pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 12px;">//sql_query("update g5_write_item set wr_7 = wr_7 + 1, wr_8 = '".G5_TIME_YMDHIS."' where wr_id = '{$wr_id}' and mb_id = '{$member['mb_id']}' "); </span><span style="font-size: 9pt; line-height: 16.5pt;"> </span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">       } else {<o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;
color:black">          alert(' BBB 실행 되었습니다.'); <o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt;font-variant-ligatures: normal;
font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;
word-spacing:0px"><span style="font-size: 9pt; line-height: 16.5pt;">    }</span> </p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;color:black">}<o:p></o:p></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:16.5pt"><span lang="EN-US" style="font-size:9.0pt;font-family:돋움;color:black">

 

 

 AAA, BBB 어떤것도 실행되지 않아서...

 왜 안되는것인지 알 수 없어서요..

 view.skin.php에서 "/exec.php",  ==> /exec.php를 다른 이름으로 호출하면  

 에러가 발생하고 있어서 호출 경로 및 함수 실행은 정상적으로 처리됩니다.

 

 AAA  BBB 둘 중에 하나는 alert되어야 할 텐데..왜 안되는지???

 

  

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

답변 1개

채택된 답변
+20 포인트

소스코드에서 보면,,,

var data = 'mode=jump&wr_id=&wr_8='; 

로 설정하셨구요...

ajax로 exec.php 로 data 파일의 값을 넘깁니다. 

 

 

exec.php 파일에서 $_POST['wr_8'] 값을 echo 로 찍어보세요.

값이 잘 넘어가는지 확인이 필요합니다. 

$_POST['wr_8'] 값이 잘넘어온다면 $wr_8[0] 값도 찍어서 확인이 필요합니다. 

 

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

더블피디
9년 전
exec.php 내의 함수는 view.skin.php에서 호출해서 불렀는데요

넘어온 값을 어떻게 echo로 찍어서 볼 수 있나요?

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

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

로그인