| | |
Doesn't check if username or email exits in database properly
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2004
Posts: 4
Reputation:
Solved Threads: 0
hi,
I have created a registration form. When the user clicks submit it goes to processRegister.asp. This is where it checks whether the username and email already exits in the database.
When i enter a email that is already in the database, the error message for the email and the username shows up.. Even if i entered a completely new username that is not in the database.
The email error message is working... but why does the username error message show up.
The email's do while loop excutes right after the do while loop for username has executed.
The block of code right towards the bottom excutes in register.asp page.
I have created a registration form. When the user clicks submit it goes to processRegister.asp. This is where it checks whether the username and email already exits in the database.
When i enter a email that is already in the database, the error message for the email and the username shows up.. Even if i entered a completely new username that is not in the database.
The email error message is working... but why does the username error message show up.
The email's do while loop excutes right after the do while loop for username has executed.
The block of code right towards the bottom excutes in register.asp page.
ASP.NET Syntax (Toggle Plain Text)
' code for username loop Do while not objRegisterRecordSet.EOF if objRegisterRecordSet("tUserName") = Request.Form("user") then Session("invaliduserName") = true ' username entered is in database exit do ' exits this loop else UserNamecounter = UserNamecounter + 1 ' username entered was not in that record end if objRegisterRecordSet.MoveNext ' goes to next record Loop
ASP.NET Syntax (Toggle Plain Text)
'code for email loop Do while not objRegisterRecordSet.EOF if objRegisterRecordSet("tEmail") = Request.Form("email") then Session("invalidEmail") = true ' email entered is in database exit do ' exits loop else Emailcounter = Emailcounter +1 ' email entered was not found at this record end if objRegisterRecordSet.MoveNext ' goes to next record Loop
ASP.NET Syntax (Toggle Plain Text)
if Session("invalidEmail") = true OR Session("invaliduserName") = true then ' if username or email entered was found in database go to register.asp page Response.Redirect("Register.asp") end if
ASP.NET Syntax (Toggle Plain Text)
'code for register.asp <% if Session("invaliduserName") = true then %> <p class="InvalidUsernameAndEmailRegisterd"> <% Response.write("The user name entered is already taken... Please choose another user name") %> </p> <% Session("invaliduserName") = false End if %> <% if Session("invaliduserName") = false then %> <p class="InvalidUsernameAndEmailRegisterd"> <% Response.write("") %></p> <% End if %> <% if Session("invalidEmail") = true then %> <p class="InvalidUsernameAndEmailRegisterd"> <% Response.Write("The email entered already exist in our database... Either you are already a memeber or you have given an incorrect email. Please enter an correct email please.") %> </p> <% Session("invalidEmail") = false end if %> <% if Session("invalidEmail") = false then %> <p class="tabledata"> <% Response.write("") %></p> <% End if %>
Last edited by sunny124; Oct 29th, 2004 at 5:30 am. Reason: Wanted to change title
![]() |
Similar Threads
- I want a database of Email IDs, Where from i can get that Database (Search Engine Optimization)
- registration form - check if username is taken (PHP)
- how to generate and email the page link to email id which is stored in database (ASP.NET)
- Check Whether Username alraedy exists in database (C#)
- check username (JavaScript / DHTML / AJAX)
- mysql_numrows not working?? (PHP)
- Perl question (Perl)
- username=email address inputted on submission>is this possible (PHP)
Other Threads in the ASP.NET Forum
- Previous Thread: asp.net application in MAC OS
- Next Thread: Printing from .NET
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net browser button c# c#gridviewcolumn cac checkbox commonfunctions compatible confirmationcodegeneration content courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit fileuploader fill flash formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols radio ratings redirect registration relationaldatabases reportemail rotatepage schoolproject search security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





