קוד:
<form method="post" name="register" action="register.asp">
<font face="arial">
<caption><u><font color="blue"><h1>טופס להרשמות לטיול בעיר חיפה</u></font></h1></caption>
<br><br><br>
<u>הכנס שם פרטי</u><br><br>
<input type="text" size="15" name="pname" >
<br><br><br>
<u>הכנס שם משפחה</u><br><br>
<input type="text" size="15" name="fname" >
<br><br><br>
<u>איפה תרצה לטייל?</u><br><br>
<input type="checkbox" name="checkbox1" value=true>הגנים הבהאים
<input type="checkbox" name="checkbox2" value=true>גן החיות בחיפה
<input type="checkbox" name="checkbox3" value=true>פארק הכרמל
<br><br><br><u>כמה אנשים בקבוצה?</u><br><br>
<SELECT name="numberpeople">
<OPTION Value="1-5">5 - 1
<OPTION Value="6-10">10 - 6
<OPTION Value="11-15" >15 - 11
<OPTION Value="16-20">20 - 16
<OPTION Value="20+">20 ומעלה
</SELECT>
<br><br><br><u>האם הקבוצה גרה בחיפה?</u><br><br>
<input type="radio" name="city" value=true onClick="radio_selection1='yes'">כן
<input type="radio" name="city" value=false onClick="radio_selection1='no'"> לא
<br><br><u>האם תרצו לשכור אוטובוס?</u><br><br>
<input type="radio" name="bus" value=true onClick="radio_selection2='yes'">כן
<input type="radio" name="bus" value=false onClick="radio_selection2='no'"> לא
<br><br><u>האם תרצו לשכור מדריך?</u><br><br>
<input type="radio" name="madrich" value=true onClick="radio_selection3='yes'">כן
<input type="radio" name="madrich" value=false onClick="radio_selection3='no'"> לא
<br><br><br>
<input type="button" value="שלח" onclick="checkData()">
    
<input type="reset" value="נקה" onclick="resetForm()">
</form>
קוד:
<%
dim c, Pname, Fname, bus, madrich,ktovet, group,place1,place2,place3
Set c=server.CreateObject("adodb.connection")
c.connectionString="provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &Server.MapPath("myDb.mdb") & ""
c.Open
Pname = request.form("pname")
Fname = request.form("fname")
bus = request.form("bus")
madrich = request.form("madrich")
ktovet = request.form("city")
group= request.form("numberpeople")
place1=request.form("checkbox1")
place2=request.form("checkbox2")
place3=request.form("checkbox3")
set rst=server.createObject("adodb.recordset")
rst.activeconnection=c
statment="select * from Users where (pname='"&Pname&"')"
rst.open statment
if rst.eof then
c.execute "insert into Users (pname, fname, bus, madrich,ktovet,numberpeople,place1,place2,place3) values ('"&Pname&"','"&Fname&"',"&bus&","&madrich&","&ktovet&",'"&group&"',"&place1&","&place2&","&place3&")"
c.close
set c=nothing
response.cookies("details")("pname")=Pname
response.cookies("details")("fname")=Fname
response.cookies("details")("bus")=bus
response.cookies("details")("madrich")=madrich
response.cookies("details")("city")=ktovet
response.cookies("details")("numberpeople")=group
response.cookies("details")("places")("place1")=place1
response.cookies("details")("places")("place2")=place2
response.cookies("details")("places")("place3")=place3
response.cookies("details").expires ="01/01/2010"
response.redirect("first page-division.html")
else
response.redirect("before.html")
end if
c.close
set c=nothing
%>