ClassicASP Split로 2차원배열 저장하기
페이지 정보
본문
[ write.asp : 입력페이지 ]
<form name="hpwrite" action="write_ok.asp" method="post">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<col width="120" />
<col />
<col />
<tr>
<td height="25"></td>
<td>이름</td>
<td>연락처</td>
<td>E-mail</td>
</tr>
<%
dim tkb_num, i
tkb_num = 5
if tkb_num > 0 then
for i = 1 to tkb_num step 1
%>
<tr>
<td style='padding-left:20px; height:30px;'>· <% response.write i %></td>
<td><input type="text" name="tk_buyer_name<% response.write i %>" style="width:110px;" value="" /></td>
<td style="padding:0 10px 0 10px;"><input type="text" name="tk_buyer_tel<% response.write i %>" style="width:140px;" value="" /></td>
<td><input type="text" name="tk_buyer_email<% response.write i %>" style="width:300px;" value="" /></td>
</tr>
<%
next
end if
%>
</table>
<input type="submit" value="티켓구매" />
</form>
[ write_ok.asp : 2차원 배열을 저장하기 ]
<%
dim tkb_num, tk_buyer_name, i
if tkb_num > 0 then
for i = 0 to tkb_num step 1
tk_buyer_name = request("tk_buyer_name" & i) &"|"& request("tk_buyer_tel" & i) &"|"& request("tk_buyer_email" & i)
if i = 1 then
tkb_buyer = tk_buyer_name
else
tkb_buyer = tkb_buyer & "," & tk_buyer_name
'tkb_buyer = tkb_buyer & "|" & tk_buyer_name
end if
next
if i = tkb_num then
tkb_buyer = tkb_buyer & ","
end if
end if
response.write ("<script language='Javascript'>")
response.write ("alert('이벤트가 등록 되었습니다.');")
response.write "document.location.href = 'view.asp'"
response.write ("</script>")
response.End()
%>
댓글목록
등록된 댓글이 없습니다.