%
function regexptest(patrn, strng)
dim regex ' 建立變量。
set regex = new regexp ' 建立規范表達式。
regex.pattern = patrn ' 設置模式。
regex.ignorecase = true ' 設置是否區分字母的大小寫。
regex.global = true ' 設置全程性質。
regexptest = regex.execute(strng) ' 執行搜索。
end function
If request.QueryString("action")="add" then
ucode = Trim(request.form("ucode"))
If ucode <> Trim(Session("Code")) then
Call Msg("請輸入正確的驗證碼!",1)
End if
webtitle = Replace_Text(request.form("webtitle"))
t1 = Replace_Text(request.form("t1"))
t2 = Replace_Text(request.form("t2"))
t3 = Replace_Text(request.form("t3"))
t4 = Trim(request.form("t4"))
t5 = Replace_Text(request.form("t5"))
t6 = Replace_Text(request.form("t6"))
t7 = Replace_Text(request.form("t7"))
ip = GetIP
if t1="" or t2="" or t3="" or t5="" or t6="" or t7="" then
Call Msg("必填內容不能為空!",1)
end if
if regexptest("(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)", tel)=false then
Call Msg("電話號碼不正確!",1)
end if
SQL = "Select * from buy"
Call Rs_Open(Rs,SQL,Conn,3,2)
Rs.Addnew
Rs("t1") = t1
Rs("t2") = t2
Rs("t3") = t3
Rs("t4") = t4
Rs("t5") = t5
Rs("t6") = t6
Rs("t7") = t7
Rs("ip") = ip
Rs.update
Call Rs_end(Rs)
Call Msg (webtitle&"成功,我們會盡快回復您!$$/index.html",4)
Else
%>
<%
carid=cint(request.QueryString("id"))
ty=request.QueryString("ty")
if ty=1 then
webtitle="租車"
SQLz = "Select * from Cars where id ="&carid
else
webtitle="買車"
SQLz = "Select * from Cared where id ="&carid
end if
Call Rs_Open(Rsz,SQLz,Conn,1,1)
If Rsz.eof or Rsz.bof then
Call Msg("請正確選擇車型!",1)
Else
cartitle=Rsz("title")
end if
%>