program | Online sendregister.asp
This page gets the contents of the form fields from the register.asp and inserts them into the database. Note that the username must be unique. So, first query to
Verify that the user name you entered already exists. If so, the user is register.asp back to the page and is asked to select another user name. If the user
The name is new and the input is passed to the database.
Sql_findmember = "SELECT count (*) from loginuser where username = '" & Username & "'"
Set rs_findmember = Application ("Conn"). Execute (Sql_findmember)
If rs_findmember (0) < > 0 Then
Session ("message") = "The ENTRY HAD BEEN INSERTED earlier ... "Try another log in name"
Response.Redirect "Register.asp"
End If
If rs_findmember (0) = 0 Then
Sql_insert = "INSERT into Loginuser (Username,useremail,password) _
VALUES (' & username & ', ' "& UserEmail &", ' "& pwd &") "
Set Rs_insert = Application ("Conn"). Execute (Sql_insert)
Session ("message") = "The ENTRY has BEEN INSERTED ... Thank You "
Response.Redirect "Index.asp"
End If
Thus, if Rs_findmember (0) Returns a value of 0, it means that the username does not exist in the database and the name is entered. Members will be able to use the station
The other part of the point. Conversely, if Rs_findmember (0) returns a value greater than 0, the user is booted back to the registered home page and is required to fill out a new user
Name.
Also note that there are some things to be wary of before inserting data into the database. The substitution function is used to make sure that when a visitor types "', you need to use the ' generation '
For.
Username = replace (Request.Form ("Txt_name"), "'", "" "