%
Set objCn = Server.CreateObject ("ADODB.Connection")
Set objRs = Server.CreateObject ("ADODB.Recordset")
objCn.ConnectionString = "Data Source="& Server.MapPath("./cgi-bin/ercsr02.mdb")
objCn.Provider = "Microsoft.JET.OLEDB.4.0"
objCn.Open
%>
<%%>
<% pagename="genel" %>
<%
'************************Error and privacy check**********************
session("message")=""
function errorcontrol()
errorcontrol=false
session("message")=""
' exit function
if trim(request("password"))="" or len(trim(request("password"))) < 6 then
errorcontrol=true
session("message")="Lütfen en az 6 karakterden oluşan kullanıcı şifrenizi giriniz"
exit function
end if
if trim(request("passwordre"))="" or len(trim(request("passwordre"))) < 6 then
errorcontrol=true
session("message")="Lütfen en az 6 karakterden oluşan kullanıcı şifre tekrarınızı giriniz"
exit function
end if
if trim(request("password")) <> trim(request("passwordre")) then
errorcontrol=true
session("message")="Lütfen şifrenizi ve şifre tekrarınızı aynı giriniz"
exit function
end if
if trim(request("name"))="" or len(trim(request("name")))<3 then
errorcontrol=true
session("message")="Lütfen adınızı giriniz"
exit function
end if
if trim(request("username"))="" or len(trim(request("username")))<2 then
errorcontrol=true
session("message")="Lütfen kullanıcı adınızı giriniz"
exit function
end if
if trim(request("day"))=0 then
errorcontrol=true
session("message")="Lütfen doğum tarihinizin gün kısmını giriniz"
exit function
end if
if trim(request("month"))=0 then
errorcontrol=true
session("message")="Lütfen doğum tarihinizin ay kısmını giriniz"
exit function
end if
if trim(request("year"))="" then
errorcontrol=true
session("message")="Lütfen doğum tarihinizin yıl kısmını tam olarak giriniz"
exit function
end if
if trim(request("email"))="" or INSTR(trim(request("email")),"@")=0 or INSTR(trim(request("email")),".")=0 or len(trim(request("email")))<5 then
errorcontrol=true
session("message")="Lütfen e-mailinizi giriniz"
exit function
end if
if trim(request("phone"))="" then
errorcontrol=true
session("message")="Lütfen telefon numaranızı giriniz"
exit function
end if
End Function
'*********************END FORM ERRORS CONTROL***********************************
if request.form()<>"" then
if not errorcontrol() then
if LCASE(trim(request("email")))<>"ercanamesaj@hotmail.com" then
sql="SELECT EMAIL FROM CUSTOMERS WHERE EMAIL='" & LCASE(trim(request("email"))) & "'"
objRs.Open sql,objCn,1,3
if not objRs.eof then
session("message")="Sistemimize bu e-mail ile daha önce giriş yapılmıştır"
end if
objRs.close
end if
sql="SELECT USERNAME FROM CUSTOMERS WHERE USERNAME='" & LCASE(trim(request("username"))) & "'"
objRs.Open sql,objCn,1,3
if not objRs.eof then
session("message")="Üzgünüz :(
Bu kullanıcı adı başkası tarafından kullanılmakta.
Lütfen başka bir kullanıcı adı seçiniz."
end if
objRs.close
'222222222222222222222222
if session("message")="" then 'That is,there is no errors UPTO this point,record this customer
set newcustomer=server.createobject("ADODB.RecordSet")
newcustomer.Open "CUSTOMERS",objCn ,1,3
customeradded=false
newcustomer.Addnew
Session("NAME")=Trim(Request("name"))
Session("USERNAME")=Trim(Request("username"))
Session("logincheck")= "OK"
Session("EMAIL")=Trim(Request("email"))
newcustomer("NAME")=Trim(Request("name"))
newcustomer("USERNAME")=lcase(Trim(Request("username")))
newcustomer("BIRTH_DATE")=Trim(Request("day")) & "/" & Trim(Request("month")) & "/" & Trim(Request("year"))
newcustomer("JOB")=Trim(Request("job"))& " "
newcustomer("GENDER")=0
newcustomer("ADDRESS")=LEFT( Trim(Request("address")) , 150 )
newcustomer("PHONE")=Trim(Request("phone"))
newcustomer("EMAIL")=lcase(Trim(Request("email")))
newcustomer("PASSWORD")= Trim(Request("password"))
newcustomer("REG_IP")=Request.ServerVariables("REMOTE_ADDR")
newcustomer("REG_DATE")=NOW
newcustomer.Update
session("CUID")=newcustomer("ID")
if request.Cookies("user")="" then
response.cookies("user")("ID")= Trim(session("CUID"))
response.cookies("user")("name")= Trim(Request("name"))
response.cookies("user")("surname")=Trim(Request("surname"))
response.cookies("user")("email")=Trim(Request("email"))
response.cookies("user").Expires=#January 01, 2010#
Response.Cookies("user").Secure = FALSE
end if
customeradded=true
session("message")="Bilgileriniz Başarı ile Kaydedilmiştir. Teşekkürler."
end if
end if
end if
%>
|
|||
|
Satan Reklam © 2003 |