台灣最大程式設計社群網站
線上人數
1107
 
會員總數:243653
討論主題:188248
歡迎您免費加入會員
討論區列表 >> ASP >> 重複報名修改
[]  
[我要回覆]
1
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
重複報名修改
價值 : 5 QP  點閱數:285 回應數:1

樓主

雷帝
門外漢
0 3
104 5
發送站內信

請問本來這個程式碼只能單一一次報名,現在想要修改成可以重複報名要如何修改.謝謝
[code]login.asp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@CodePage=65001%>
<%Session.CodePage=65001
response.charset="UTF-8"
Response.CacheControl="no-cache"
Response.AddHeader "Pragma","no-cache"
Response.Expires=-1%>
<title></title>
<link href="../StyleSheet/GRAStyleSheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div align="center">
<%If Len(Session("id"))=0 Then
msa="\n逾時30分鐘未操作,請重新登入!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "top.location.href='Logout.asp';</script>"
Else%>
<!-- #Include File="dbconn.asp" -->
<%Session("schoolname")="大陸地區大學學歷甄試"

Chktmp11=SortStr(Tmp_year,3)
Chktmp11=Chktmp11+SortStr(Tmp_examclass,1)
Chktmp11=Chktmp11+SortStr(Session("id"),10)
Chktmp11=Chktmp11+SortStr(Session("pdy"),2)
Chktmp11=Chktmp11+SortStr(Session("pdm"),2)
Chktmp11=Chktmp11+SortStr(Session("pdd"),2)
Chktmp11=Chktmp11+SortStr(Session("UserIP"),15)
Chktmp13=SortStrId(Session("id"))
Chktmp23=SortStrDD(Session("pdy"))
Chktmp33=SortStrDD(Session("pdm"))
Chktmp43=SortStrDD(Session("pdd"))
If Chktmp11>0 or Chktmp13>0 or Chktmp23>0 or Chktmp33>0 or Chktmp43>0 Then
msa="\n請與大陸地區大學學歷甄試大陸地區大學學歷甄試試務小組聯絡!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "top.location.href='Logout.asp';</script>"
Else

Set rs1=Server.CreateObject("ADODB.Recordset")
sqlstr1="select birthdayyear,birthdaymonth,birthdaydate,name,degreec,disciplinec"
sqlstr1=sqlstr1&" from dbo.examinee_base(nolock)"
sqlstr1=sqlstr1&" where id='"&Session("id")&"'"
sqlstr1=sqlstr1&" and year='"&Tmp_year&"'"
rs1.Open sqlstr1,conn

'取IP
dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),"unknown")>0 Then
strIPAddr=Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),",")>0 Then
strIPAddr=Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),1,InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),",")-1)
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),";")>0 Then
strIPAddr=Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),1,InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),";")-1)
Else
strIPAddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
Session("UserIP")=Trim(Mid(strIPAddr,1,30))

'login 階段寫入log防亂try的,01:登入系統
Set rsBt=Server.CreateObject("ADODB.Recordset")
sqlstrBt="insert into dbo.button_log("
sqlstrBt=sqlstrBt&"year,degreec,disciplinec,id,ip_address,buttonc,operatetime)"
sqlstrBt=sqlstrBt&" values(N'"&Tmp_year&"',N'"&Session("degreec")&"',N'"&Session("disciplinec")&"',"
sqlstrBt=sqlstrBt&"'"&Session("id")&"','"&Session("UserIP")&"','01',GETDATE())"
'response.Write(sqlstrBt)
'response.End()
conn.Execute sqlstrBt

'取報名期間
Set rs2=Server.CreateObject("ADODB.Recordset")
sqlstr2="select entertimebeg1,entertimeend1,entertimebeg2,entertimeend2"
sqlstr2=sqlstr2&" from dbo.param_base(nolock)"
sqlstr2=sqlstr2&" where year='"&Tmp_year&"'"
rs2.Open sqlstr2,conn

If rs2.Eof Then
%>
<div style="text-align:center;">
系統尚未開放使用!
</div>
<%
response.End()
End If

If not rs2.Eof Then
'筆試階段
If mid(rs2("entertimebeg1"),1,1)="1" Then
begdate1=CStr(CInt(mid(rs2("entertimebeg1"),1,3))+1911)
For i=4 to len(rs2("entertimebeg1"))-5
If mid(rs2("entertimebeg1"),i,1)="年" or mid(rs2("entertimebeg1"),i,1)="月" Then
begdate1=begdate1+"/"
ElseIf mid(rs2("entertimebeg1"),i,1)<>"日" Then
begdate1=begdate1+mid(rs2("entertimebeg1"),i,1)
End If
Next
enddate1=CStr(CInt(mid(rs2("entertimeend1"),1,3))+1911)
For i=4 to len(rs2("entertimeend1"))-5
If mid(rs2("entertimeend1"),i,1)="年" or mid(rs2("entertimeend1"),i,1)="月" Then
enddate1=enddate1+"/"
ElseIf mid(rs2("entertimeend1"),i,1)<>"日" Then
enddate1=enddate1+mid(rs2("entertimeend1"),i,1)
End If
Next
Else
begdate1=CStr(CInt(mid(rs2("entertimebeg1"),1,2))+1911)
For i=3 to len(rs2("entertimebeg1"))-5
If mid(rs2("entertimebeg1"),i,1)="年" or mid(rs2("entertimebeg1"),i,1)="月" Then
begdate1=begdate1+"/"
ElseIf mid(rs2("entertimebeg1"),i,1)<>"日" Then
begdate1=begdate1+mid(rs2("entertimebeg1"),i,1)
End If
Next
enddate1=CStr(CInt(mid(rs2("entertimeend1"),1,2))+1911)
For i=3 to len(rs2("entertimeend1"))-5
If mid(rs2("entertimeend1"),i,1)="年" or mid(rs2("entertimeend1"),i,1)="月" Then
enddate1=enddate1+"/"
ElseIf mid(rs2("entertimeend1"),i,1)<>"日" Then
enddate1=enddate1+mid(rs2("entertimeend1"),i,1)
End If
Next
End If
'論文審查階段
If mid(rs2("entertimebeg2"),1,1)="1" Then
begdate2=CStr(CInt(mid(rs2("entertimebeg2"),1,3))+1911)
For i=4 to len(rs2("entertimebeg2"))-5
If mid(rs2("entertimebeg2"),i,1)="年" or mid(rs2("entertimebeg2"),i,1)="月" Then
begdate2=begdate2+"/"
ElseIf mid(rs2("entertimebeg2"),i,1)<>"日" Then
begdate2=begdate2+mid(rs2("entertimebeg2"),i,1)
End If
Next
enddate2=CStr(CInt(mid(rs2("entertimeend2"),1,3))+1911)
For i=4 to len(rs2("entertimeend2"))-5
If mid(rs2("entertimeend2"),i,1)="年" or mid(rs2("entertimeend2"),i,1)="月" Then
enddate2=enddate2+"/"
ElseIf mid(rs2("entertimeend2"),i,1)<>"日" Then
enddate2=enddate2+mid(rs2("entertimeend2"),i,1)
End If
Next
Else
begdate2=CStr(CInt(mid(rs2("entertimebeg2"),1,2))+1911)
For i=3 to len(rs2("entertimebeg2"))-5
If mid(rs2("entertimebeg2"),i,1)="年" or mid(rs2("entertimebeg2"),i,1)="月" Then
begdate2=begdate2+"/"
ElseIf mid(rs2("entertimebeg2"),i,1)<>"日" Then
begdate2=begdate2+mid(rs2("entertimebeg2"),i,1)
End If
Next
enddate2=CStr(CInt(mid(rs2("entertimeend2"),1,2))+1911)
For i=3 to len(rs2("entertimeend2"))-5
If mid(rs2("entertimeend2"),i,1)="年" or mid(rs2("entertimeend2"),i,1)="月" Then
enddate2=enddate2+"/"
ElseIf mid(rs2("entertimeend2"),i,1)<>"日" Then
enddate2=enddate2+mid(rs2("entertimeend2"),i,1)
End If
Next
End If
End If
begdate1=begdate1+" "+right(rs2("entertimebeg1"),5)+":01"
enddate1=enddate1+" "+right(rs2("entertimeend1"),5)+":01"
begdate2=begdate2+" "+right(rs2("entertimebeg2"),5)+":01"
enddate2=enddate2+" "+right(rs2("entertimeend2"),5)+":01"
rs2.Close

If not rs1.Eof then
'資料存在
If strcomp(Session("pdy"),rs1("birthdayyear"),0)=0 and strcomp(Session("pdm"),rs1("birthdaymonth"),0)=0 and strcomp(Session("pdd"),rs1("birthdaydate"),0)=0 Then
'比對正確
Session("name")=rs1("name")
Session("degreec")=rs1("degreec")
Session("disciplinec")=rs1("disciplinec")

'寫入Log,若有多筆報名僅記錄第一筆01:登入系統
Set rsBt=Server.CreateObject("ADODB.Recordset")
sqlstrBt="insert into dbo.button_log("
sqlstrBt=sqlstrBt&"year,degreec,disciplinec,id,ip_address,buttonc,operatetime)"
sqlstrBt=sqlstrBt&" values(N'"&Tmp_year&"',N'"&Session("degreec")&"',N'"&Session("disciplinec")&"',"
sqlstrBt=sqlstrBt&"'"&Session("id")&"','"&Session("UserIP")&"','01',GETDATE())"
'response.Write(sqlstrBt)
conn.Execute sqlstrBt

If begdate1 <> EMPTY then
If Now() >= CDate(begdate1) and Now() <= CDate(enddate1) Then
'報名期間
response.write "<script>location.href='SelSign.asp'</script>"
Else
'非報名期間
response.write "<script>location.href='Menu.asp'</script>"
End If
Else
msa="\n系統尚未開放使用!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
Else
Session.abandon()
msa="\n該身分證件號碼資料已存在,但出生日期輸入錯誤,請重新輸入!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "window.history.back();</script>"
End If
Else
'資料不存在
If begdate1 <> EMPTY then
If Now() >= CDate(begdate1) and Now() <= CDate(enddate1) Then
'報名期間
ShowDetail
Else
msa="\n找不到輸入的身分證件號碼資料!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
Else
msa="\n系統尚未開放使用!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
End If
rs1.Close
conn.Close
End If
End If
Sub ShowDetail%>
<table border="0" id="table1" cellspacing="0" cellpadding="0" class="table-main">
<tr>
<td align="center" colspan="2" class="table-main-td1">
<b><span style="color: #0000FF"><%=Tmp_year&"年度"&Session("schoolname")%></span></b>
<hr />
</td>
</tr>
<tr>
<td style="color: #ffffff; height: 40px; background: #000066;">
報名流程:<b><span style="font-size: 15px; color: #FFFF00">►核對重要資料</span></b> ►選擇甄試學門領域 ►選擇選考科目 ►填寫基本資料 ►填寫完成
</td>
</tr>
<tr><td height="20"></td></tr>
<tr>
<td width="100%" height="40" align="center">
<table id="table12" cellspacing="0" cellpadding="0" style="width: 50%; border-color: #008080; border: 1px;">
<tr>
<td align="left" style="width: 12%; height: 25px; background: #FFD5AA; border: 1px solid #ffffff; padding: 0 5px 0 5px;">身分證件號碼</td>
</tr>
<tr>
<td align="center" style="width: 12%; height: 30px; border: 1px solid #ffffff; padding: 1px;">
<span style="font-size: 18px;"><b><%=Session("id")%></b></span></td>
</tr>
<tr>
<td align="left" style="width: 12%; height: 25px; background: #FFD5AA; border: 1px solid #ffffff; padding: 0 5px 0 5px;">出生日期</td>
</tr>
<tr>
<td align="center" style="width: 12%; height: 30px; border: 1px solid #ffffff; padding: 1px;">
<span style="font-size: 18px;"><b><%=Session("pdy")&"年"&Session("pdm")&"月"&Session("pdd")&"日"%></b></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="width: 100%; height:80px; line-height: 22px;">
<span style="color: #FF0000">※</span>請核對上列【<b>身分證號</b>】及【<b>出生日期</b>】是否正確,<br />
<span style="color: #FF0000;"><b>(如因身分證號錯誤造成無法應考,由考生自行負責,如有疑問請電洽 大陸地區大學學歷甄試試務小組:04-22851900)</b></span><br />
正確請按 <span style="color: #0000FF;"><b>下一步</b></span> ,錯誤請按 <span style="color: #0000FF;"><b>重新輸入</b></span> 。
</td>
</tr>
<tr>
<td align="center" style="width: 100%; padding: 5px 0 5px 0;">
<input type="button" value=" 重新輸入 " onclick="javascript:location.href='logout.asp'" style="padding: 3px 3px 3px 3px;" /> 
<input type="submit" value=" 下一步 " onclick="javascript:location.href='signlogin.asp'" style="padding: 3px 3px 3px 3px;" />
</td>
</tr>
<tr>
<td style="width: 100%;">
<hr />
</td>
</tr>
</table>
<%End Sub%>
</div>
</body>
</html>


搜尋相關Tags的文章: [ 報名 ] ,
本篇文章發表於2018-06-14 15:36
別忘捐VP感謝幫助你的人 新手會員瞧一瞧
1樓
作者回應

雷帝
檢舉此回應
這是第二個程式
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@CodePage=65001%>
<%Session.CodePage=65001
response.charset="UTF-8"
Response.CacheControl="no-cache"
Response.AddHeader "Pragma","no-cache"
Response.Expires=-1
%>
<link href="../StyleSheet/GRAStyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="../ColorBox/jquery.colorbox.js"></script>
<title>大陸地區大學學歷甄試</title>
</head>

<body>
<div align="center">
<%
poss_year=107
If Request("P")="" or Request("P")="pp" Then
Session.Abandon()'避免未正常報名作業,清空Session值
Session.timeout = 30 '30分鐘
Response.Cookies("EMHD")("year")="107"%>
<form action="login_EMHD.asp" method="post" name="EMHD">
<table border="0" width="1000" id="table10" cellspacing="0" bgcolor="#FFFFFF" cellpadding="0">
<tr>
<td align="center" colspan="2" class="table-main-td1">
<b><%=poss_year%>年度大陸地區大學學歷甄試</b>
<hr />
</td>
</tr>
<tr>
<td align="left" width="100%" colspan="2">
<div style="font-size: 14px; color:#0000FF; margin: 5px 0 5px 0;">注意事項:</div>
<p align="left" style="margin-top: 5px; margin-bottom: 5px">
1.填寫報名資料須在<b><u><font color="#0000FF">30分鐘內</font></u></b>完成,報考碩士以上學歷甄試者,請先行準備碩、博士論文資料檔案。</p>
<p align="left" style="margin-top: 5px; margin-bottom: 5px">
2.完成填寫報名資料後,<b><u><font color="#0000FF">請務必一定要重新登入系統</font></u></b>檢查資料是否正確。</p>
</td>
</tr>
<tr>
<td align="right" style="width: 40%; padding: 10px 0 10px 0;">身分證件號碼:</td>
<td align="left" style="width: 60%; padding: 10px 0 10px 0;">
<input type="text" name="tmp_id" size="12" maxlength="10" onblur="this.value=this.value.toUpperCase()" />(限輸入[半形]英文及數字,範例:E123456789)
</td>
</tr>
<tr>
<td align="right" style="width: 40%; padding: 10px 0 10px 0;">出生年月日:</td>
<td align="left" style="width: 60%; padding: 10px 0 10px 0;">
民國<input name="tmp_pdy" size="2" maxlength="2" />年<input name="tmp_pdm" size="2" maxlength="2" />月<input name="tmp_pdd" size="2" maxlength="2" />日
(限輸入[半形]數字,範例:80年12月31日)
</td>
</tr>
<tr>
<td colspan="2" height="50">
<input type="hidden" name="P" value="pp1" />
<p align="center"><input type="submit" value="登入系統" style="padding: 3px 3px 3px 3px;" /></p>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<hr />
</td>
</tr>
</table>
</form>
<%Else%>
<!-- #Include File="dbconn.asp" -->
<%Response.Write "<input id='hidden1' type='hidden' name='P' value='pp'>"
If Len(Request("tmp_id"))=0 or Len(Request("tmp_pdy"))=0 or Len(Request("tmp_pdm"))=0 or Len(Request("tmp_pdd"))=0 Then
msa="\n考生身分證件號碼及出生年月日,請勿空白!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "window.history.back();</script>"
Else
Session("id")=Ucase(Replace(Request("tmp_id")," ",""))
Session("pdy")=Replace(Request("tmp_pdy")," ","")
If Len(Replace(Request("tmp_pdm")," ",""))<2 Then
Session("pdm")="0"&Replace(Request("tmp_pdm")," ","")
Else
Session("pdm")=Replace(Request("tmp_pdm")," ","")
End If
If Len(Replace(Request("tmp_pdd")," ",""))<2 Then
Session("pdd")="0"&Replace(Request("tmp_pdd")," ","")
Else
Session("pdd")=Replace(Request("tmp_pdd")," ","")
End If
Chktmp11=SortStr(Session("id"),10)
Chktmp21=SortStr(Session("pdy"),2)
Chktmp31=SortStr(Session("pdm"),2)
Chktmp41=SortStr(Session("pdd"),2)
Chktmp13=SortStrId(Session("id"))
Chktmp23=SortStrDD(Session("pdy"))
Chktmp33=SortStrDD(Session("pdm"))
Chktmp43=SortStrDD(Session("pdd"))
If ChkTmp11>0 or Chktmp13>0 or ChkTmp21>0 or Chktmp23>0 or ChkTmp31>0 or Chktmp33 or ChkTmp41>0 or Chktmp43 Then
msa="\n考生身分證件號碼及出生年月日,請勿填入非數字及非英文!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "window.history.back();</script>"
Else
Set rs1=Server.CreateObject("ADODB.Recordset")
sqlstr1="select birthdayyear,birthdaymonth,birthdaydate,name"
sqlstr1=sqlstr1&" from examinee_base"
sqlstr1=sqlstr1&" where id='"&Session("id")&"'"
sqlstr1=sqlstr1&" and year='"&Tmp_year&"'"
Chktmp11=SortStr(Tmp_year,3)
Chktmp21=SortStr(Tmp_examclass,1)
Chktmp31=SortStr(Session("id"),10)
If Chktmp11>0 or Chktmp21>0 or Chktmp31>0 Then
msa="\n請與大陸地區大學學歷甄試大陸地區大學學歷甄試試務小組聯絡!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "top.location.href='Logout.asp';</script>"
Else
rs1.Open sqlstr1,conn
If not rs1.Eof then
Response.redirect "Login.asp"
Else
Response.write "<script>$.colorbox({ href: 'PrivacyAnn.asp', width: '980px', overlayClose: false, escKey: false, closeButton: false });</script>"
End If
End If
End If
End If
End If%>
</div>
</body>
<script type="text/javascript" language="JavaScript">
document.forms['EMHD'].elements['tmp_id'].focus();
</script>
</html>
本篇文章回覆於2018-06-14 15:38
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
   
1

回覆
如要回應,請先登入.