input 박스에서 0 을 입력하면 값이 전송이 되지 않나요?

· 2013-08-23 (금) 08:37:44 · 1083 · 2
input 박스에서 0 을 입력하여 서브밋을 하면 입력된 값이 없다고 값을 답는 페이지에서에서 경고창을 보냅니다.

해결 방법이 없을까요?

================= 입력페이지 ====================

<form name=auction_tender id=auction_tender method=post action="<?=$board_skin_path?>/tender.php" target=hiddenframe style="margin:18px 0 0 0; float:left;">
<input type=hidden name=bo_table value=<?=$bo_table?>>
<input type=hidden name=wr_id value=<?=$wr_id?>>
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN00.png" onclick="document.getElementById('point').value='0'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN01.png" onclick="document.getElementById('point').value='1'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN02.png" onclick="document.getElementById('point').value='2'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN03.png" onclick="document.getElementById('point').value='3'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN04.png" onclick="document.getElementById('point').value='4'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN05.png" onclick="document.getElementById('point').value='5'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN06.png" onclick="document.getElementById('point').value='6'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN07.png" onclick="document.getElementById('point').value='7'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN08.png" onclick="document.getElementById('point').value='8'; return false;" />
<input type="image" src="<?=$board_skin_path?>/img/ball/ballN09.png" onclick="document.getElementById('point').value='9'; return false;" />
<br />
<input type=text name=point id=point value="" required numeric itemname="구매 번호" style=" border:1px solid #D3D3D3; width:80px; text-align:right; padding-right:10px;">
번호를 구매하겠습니다.
</form>


=====================값을 받는 페이지============

<?
$g4_path = "../../..";
include_once("$g4_path/common.php");

if (!$bo_table && !$wr_id)
die("bo_table 혹은 wr_id 가 없습니다.");

include_once("$board_skin_path/auction.lib.php");
include_once("$g4[path]/head.sub.php");

if (!$write)
alert_only("bo_table 과 wr_id 를 확인하십시오.");

if (!$point && !point==0)
alert_only("구매하실 번호를 입력해주세요.");

tender_send($wr_id, $point);

?>



|

댓글 2개

2013-08-23 (금) 09:05:05
단순히 if(!$point){} 조건문은 변수값이 없는 경우 뿐 아니라 0의 경우도 포함됩니다.
이 경우에는 if($point==''){} 혹은 if($point==null){} 등으로 처리하심이
감사합니다. 초보인데요, 하나씩 배워 나갑니다. ^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
13-08-23 조회 1,653
13-08-23 조회 1,086
13-08-23 조회 2,053
13-08-23 조회 1,759
13-08-23 조회 1,273
13-08-23 조회 1,084
13-08-22 조회 811
13-08-22 조회 896
13-08-22 조회 2,224
13-08-22 조회 1,083
13-08-22 조회 1,083
13-08-22 조회 1,713
13-08-22 조회 1,639
13-08-22 조회 1,091
13-08-22 조회 879
13-08-22 조회 895
13-08-22 조회 1,846
13-08-22 조회 1,269
13-08-22 조회 2,866
13-08-22 조회 955