?? saveaddress.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="error.asp"-->
<title><%=sitename%>-保存聯系人</title>
<%
dim class_id,name,sex,age,tel_home,tel_work,tel_hand,address_home,address_house,company,email,oicq,icq,msn,homepage,photo,photo_width,photo_height,grade,remark
class_id=request.form("class_id")
name=trim(lcase(request.form("name")))
sex=request.form("sex")
age=trim(request.form("age"))
tel_home=trim(request.form("tel_home"))
tel_work=trim(request.form("tel_work"))
tel_hand=trim(request.form("tel_hand"))
address_home=trim(request.form("address_home"))
address_house=trim(request.form("address_house"))
company=trim(request.form("company"))
email=trim(request.form("email"))
oicq=trim(request.form("oicq"))
icq=trim(request.form("icq"))
msn=trim(request.form("msn"))
homepage=trim(request.form("homepage"))
photo=trim(request.form("photo"))
photo_width=trim(request.form("photo_width"))
photo_height=trim(request.form("photo_height"))
grade=trim(request.form("grade"))
remark=trim(request.form("remark"))
if class_id="" then
founderr=true
errinfo="<li>請選擇一個分類<br>"
end if
if name="" then
founderr=true
errinfo=errinfo&"<li>請輸入聯系人姓名<br>"
elseif len(name)>5 then
founderr=true
errinfo=errinfo&"<li>聯系人姓名不能超過5個字符<br>"
end if
if age="" then
age="-"
elseif isnumeric(age)=false or len(age)>2 then
founderr=true
errinfo=errinfo&"<li>年齡只能是1~99之間的整數<br>"
end if
if sex="" then
founderr=true
errinfo=errinfo&"<li>請選擇性別<br>"
end if
if tel_home="" then
tel_home="-"
elseif len(tel_home)>15 then
founderr=true
errinfo=errinfo&"<li>家庭/住所電話不能超過15個字符<br>"
end if
if tel_work="" then
tel_work="-"
elseif len(tel_work)>15 then
founderr=true
errinfo=errinfo&"<li>工作電話不能超過15個字符<br>"
end if
if tel_hand="" then
tel_hand="-"
elseif len(tel_hand)>15 then
founderr=true
errinfo=errinfo&"<li>私人手機不能超過15個字符<br>"
end if
if address_home="" then
address_home="-"
elseif len(address_home)>15 then
founderr=true
errinfo=errinfo&"<li>家庭地址不能超過20個字符<br>"
end if
if address_house="" then
address_house="-"
elseif len(address_house)>20 then
founderr=true
errinfo=errinfo&"<li>住所地址不能超過20個字符<br>"
end if
if company="" then
company="-"
elseif len(company)>20 then
founderr=true
errinfo=errinfo&"<li>工作單位不能超過20個字符<br>"
end if
if email="" then
email="-"
elseif len(email)>50 then
founderr=true
errinfo=errinfo&"<li>郵箱不能超過50個字符<br>"
end if
if oicq="" then
oicq="-"
elseif len(oicq)>20 then
founderr=true
errinfo=errinfo&"<li>OICQ不能超過20個字符<br>"
end if
if icq="" then
icq="-"
elseif len(icq)>20 then
founderr=true
errinfo=errinfo&"<li>ICQ不能超過20個字符<br>"
end if
if msn="" then
msn="-"
elseif len(msn)>50 then
founderr=true
errinfo=errinfo&"<li>MSN不能超過50個字符<br>"
end if
if homepage="" then
homepage="-"
elseif len(homepage)>50 then
founderr=true
errinfo=errinfo&"<li>網頁不能超過50個字符<br>"
end if
if photo="" then
photo="-"
elseif len(photo)>100 then
founderr=true
errinfo=errinfo&"<li>照片不能超過100個字符<br>"
end if
if photo<>"" then
if photo_width="" or photo_height="" then
photo_width=0
photo_height=0
elseif isnumeric(photo_width)=false or isnumeric(photo_height)=false then
founderr=true
errinfo=errinfo&"<li>照片寬和高只能輸入整數<br>"
elseif photo_width>200 or photo_width<20 or photo_height>250 or photo_height<20 then
founderr=true
errinfo=errinfo&"<li>照片寬在20-200象素之間,高在20-250象素之間<br>"
end if
end if
if grade="" then
founderr=true
errinfo=errinfo&"<li>請選擇一個關系等級<br>"
end if
if remark="" then
remark="-"
elseif len(remark)>250 then
founderr=true
errinfo=errinfo&"<li>備注不能超過250個字符<br>"
end if
if founderr=true then
call errweb()
else
conn.execute("insert into address_list(class_id,user,name,sex,age,tel_home,tel_work,tel_hand,address_home,address_house,company,email,oicq,icq,msn,homepage,photo,photo_width,photo_height,addtime,grade,hits,remark) values("&class_id&",'"&member&"','"&name&"','"&sex&"','"&age&"','"&tel_home&"','"&tel_work&"','"&tel_hand&"','"&address_home&"','"&address_house&"','"&company&"','"&email&"','"&oicq&"','"&icq&"','"&msn&"','"&homepage&"','"&photo&"',"&photo_width&","&photo_height&",now(),"&grade&",0,'"&remark&"')")
conn.execute("update address_class set classtotal=classtotal+1 where id="&class_id&"")
success="<li>添加聯系人成功<br><li><a href='addaddress.asp'>繼續添加聯系人</a><br><li><a href='main.asp'>返回"&sitename&"</a><br>"
call successweb()
end if
conn.close
set conn=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -