php문에서 mysql쓰기 고급 질문
페이지 이동 없이 서브 미트 주면 그페이지 자체에서 mysql 에 인설트 하려고 합니다.
어떻게 해야 할까요???
아래 코드는 대충 하다가 포기한 소스입니다.
[code]
<!--------------------------------- 오프라인 관리 추가 --------------------------------->
<p>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border:solid 1px #D7D7D7">
<tr bgcolor="EFEFEF" align="center">
<td>상품명</td>
<td>주문자명</td>
<td>결제금액</td>
<td>주문일시</td>
</tr>
<tr>
<td bgcolor="EFEFEF">
<input type="text" name="shop_add_1">
</td>
<td>
<input type="text" name="shop_add_2">
</td>
<td bgcolor="EFEFEF">
<input type="text" name="shop_add_3">
</td>
<td>
<input type="text" name="shop_add_4" readonly onclick="win_calendar('shop_add_4', document.getElementById('shop_add_4').value, '');">
</td>
</tr>
<tr>
<td colspan="4" align="right">
<button class="btn1" style="cursor:pointer;height:20px;width:45px" onclick="shop_add()">확인</button>
</td>
</tr>
</table>
<script>
function shop_add() {
if (document.getElementById("shop_add_1").value == ""){
alert("상품명을 입력하여 주십시오.");
document.getElementById("shop_add_1").focus();
return;
}
if (document.getElementById("shop_add_2").value == ""){
alert("주문자를 입력하여 주십시오.");
document.getElementById("shop_add_2").focus();
return;
}
if (document.getElementById("shop_add_3").value == ""){
alert("결제금액을 입력하여 주십시오.");
document.getElementById("shop_add_3").focus();
return;
}
if (document.getElementById("shop_add_4").value == ""){
alert("주문일시를 입력하여 주십시오.");
document.getElementById("shop_add_4").focus();
return;
} else {
// document.write("");
location.reload();
return ;
}
}
</script>
<!-------------------------------- /오프라인 관리 추가/ -------------------------------->[/code]
위 소스에서
[code]
document.write("");
[/code]
를 응용하여 인설트 시키려고 했는데 오류가 팍팍 뜨네요^^
흠.... 직접 짠거라 한계가 있네요 ㅇㅅㅇ;;
어떻게 해야 할까요???
아래 코드는 대충 하다가 포기한 소스입니다.
[code]
<!--------------------------------- 오프라인 관리 추가 --------------------------------->
<p>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border:solid 1px #D7D7D7">
<tr bgcolor="EFEFEF" align="center">
<td>상품명</td>
<td>주문자명</td>
<td>결제금액</td>
<td>주문일시</td>
</tr>
<tr>
<td bgcolor="EFEFEF">
<input type="text" name="shop_add_1">
</td>
<td>
<input type="text" name="shop_add_2">
</td>
<td bgcolor="EFEFEF">
<input type="text" name="shop_add_3">
</td>
<td>
<input type="text" name="shop_add_4" readonly onclick="win_calendar('shop_add_4', document.getElementById('shop_add_4').value, '');">
</td>
</tr>
<tr>
<td colspan="4" align="right">
<button class="btn1" style="cursor:pointer;height:20px;width:45px" onclick="shop_add()">확인</button>
</td>
</tr>
</table>
<script>
function shop_add() {
if (document.getElementById("shop_add_1").value == ""){
alert("상품명을 입력하여 주십시오.");
document.getElementById("shop_add_1").focus();
return;
}
if (document.getElementById("shop_add_2").value == ""){
alert("주문자를 입력하여 주십시오.");
document.getElementById("shop_add_2").focus();
return;
}
if (document.getElementById("shop_add_3").value == ""){
alert("결제금액을 입력하여 주십시오.");
document.getElementById("shop_add_3").focus();
return;
}
if (document.getElementById("shop_add_4").value == ""){
alert("주문일시를 입력하여 주십시오.");
document.getElementById("shop_add_4").focus();
return;
} else {
// document.write("");
location.reload();
return ;
}
}
</script>
<!-------------------------------- /오프라인 관리 추가/ -------------------------------->[/code]
위 소스에서
[code]
document.write("");
[/code]
를 응용하여 인설트 시키려고 했는데 오류가 팍팍 뜨네요^^
흠.... 직접 짠거라 한계가 있네요 ㅇㅅㅇ;;
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 3개