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

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개

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

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
12년 전 조회 1,892
12년 전 조회 1,559
12년 전 조회 1,018
12년 전 조회 3,067
12년 전 조회 1,564
12년 전 조회 1,005
12년 전 조회 1,965
12년 전 조회 1,675
12년 전 조회 1,184
12년 전 조회 1,000
12년 전 조회 732
12년 전 조회 812
12년 전 조회 2,130
12년 전 조회 1,004
12년 전 조회 1,003
12년 전 조회 1,631
12년 전 조회 1,576
12년 전 조회 1,016
12년 전 조회 799
12년 전 조회 815