السلام عليكم ورحمة الله وبركاته
من فضلكم رجاءا من فضلكم اريد كود asp لعمل login للـ users وربطه بالـ database
علما بأن الـ data base (acces)
وشكرا
السلام عليكم
السلام عليكم ورحمة الله وبركاته
من فضلكم رجاءا من فضلكم اريد كود asp لعمل login للـ users وربطه بالـ database
علما بأن الـ data base (acces)
وشكرا
السلام عليكم
على العموم الكود دة انا قراتة قبل كدة
يارب الاقية تانى علشان اجيبهولك
والسلام ختام
سوري اتأخرت بالرد بس كنت مشغولة
الكود هو
هلأ بالنسبة لل user اعمله add في البداية
<%@ Language=VBScript %>
<%
Name = Request.Form("uName")
Num = Request.Form("uNum")
Mail = Request.Form("uMail")
Address = Request.Form("uAddress")
Phone = Request.Form("uPhone")
if Mail="" then
session("Msg") = "<font color=Red>You must enter your Mail !!!</font>"
Response.Redirect("FeedBack.asp")
end if
x = InStr(Mail,"@")
if x< 0 then
session("Msg") = "<font color=Red>Please check your E-Mail !!!</font>"
Response.Redirect("FeedBack.asp")
end if
x = InStr(Mail,".")
if x < 0 then
session("Msg") = "<font color=Red>Please check your E-Mail !!!</font>"
Response.Redirect("NewUser.asp")
end if
if Name="" then
session("Msg") = "<font color=Red>You must enter your Name !!!</font>"
Response.Redirect("NewUser.asp")
end if
if Num="" then
session("Msg") = "<font color=Red>You must enter your Credit Card Number !!!</font>"
Response.Redirect("NewUser.asp")
end if
if Address="" then
session("Msg") = "<font color=Red>You must enter your Address !!!</font>"
Response.Redirect("NewUser.asp")
end if
if Phone="" then
session("Msg") = "<font color=Red>You must enter your Phone !!!</font>"
Response.Redirect("NewUser.asp")
end if
SQL = "Insert Into Users values('" & Num & "','" & Name & "','" & Address & "','" & Mail & "','" & Phone & "')"
session("db").Execute(SQL)
session("Msg") = "<font color=green>Thank you for your Registration.</font>"
Response.Redirect("UserLogin.asp")
%>اما بالنسبة ل check user login
<%@ Language=VBScript %>
<%
cr = Request.Form("CrNum")
crType = Request.Form("CrType")
Back = Request.QueryString("Back")
tp = Request.QueryString("tp")
id = Request.QueryString("id")
cat = Request.QueryString("cat")
if crType = "" then
session("Msg") = "<font color=Red>you must select card type !!!</font>"
Response.Redirect("UserLogin.asp?Back="&Back&"&id="&id&"&tp="&tp&"&cat="&cat)
end if
SQL = "select * from Users where CrNum = '" & cr & "'"
set result = session("db").Execute(SQL)
if result.EOF then
session("Msg") = "<font color=Red>Invalid User Login !!!</font>"
Response.Redirect("UserLogin.asp?Back="&Back&"&id="&id&"&tp="&tp&"&cat="&cat)
else
set UserRec = session("db").Execute("Select * From Banks where CrNum = '" & result("CrNum") & "' and CrType = '" & CrType & "'")
if UserRec.EOF then
session("Msg") = "<font color=Red>[" & result("Name") & "] has no bank account !!!</font>"
Response.Redirect("UserLogin.asp?Back="&Back&"&id="&id&"&tp="&tp&"&cat="&cat)
else
session("id") = cr
session("mount") = UserRec("Mount")
session("Msg") = "<font color=green>Welcome [" & result("Name") & "] !!!</font>"
if Request.QueryString("Back") <> "" then
Response.Redirect(Back&"?Back="&Back&"&id="&id&"&tp="&tp&"&cat="&cat)
else
Response.Redirect("Basket.asp?Back="&Back&"&id="&id&"&tp="&tp&"&cat="&cat)
end if
end if
end if
%>اذا بدك الكود run ابعتلي ايميلك واحكيلي بالزبط شو بدك اياه بالزبط
هذا الموضوع مغلق.