Preventing Duplicate Users

R

Rhyno

Hi there

I've created protected ASP pages in my website following instructions in
article http://support.microsoft.com/kb/825498

Users are prompted to log on or register if they aren't already registered.

The registration form is split over two ASP pages. The first page simply
asks for email address, username and password and, on submit, posts to the
second ASP page.

The second page asks the user for contact details (name, address etc.)

I would like the first page of the registration to check the database to
find if there are any records with the same username or email address before
posting to the second page.

If the username or email address already exists, I want to return an error
prompting the visitor to try another username or email address.

I've set the properties of these fields in the access database to disallow
duplicates. However, if a visitor enters a username or email address that
already exists in the Access Database, the record is not added to the
database but the user is unaware and can complete and submit the registration
form.

Any help would be greatly appreciated!

Thanks in advance.

Ryan
 
S

Stefan B Rusynko

Before you add to the DB always check for duplicates during registration

Use the same process as your Log in, But check for EOF first (no record found )

<%
IF objRS.EOF THEN ' not a dupe
' do your registration ADD routine here
ELSE ' is a dupe
' send them back to start page again with different credentials
END IF

%>
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi there
|
| I've created protected ASP pages in my website following instructions in
| article http://support.microsoft.com/kb/825498
|
| Users are prompted to log on or register if they aren't already registered.
|
| The registration form is split over two ASP pages. The first page simply
| asks for email address, username and password and, on submit, posts to the
| second ASP page.
|
| The second page asks the user for contact details (name, address etc.)
|
| I would like the first page of the registration to check the database to
| find if there are any records with the same username or email address before
| posting to the second page.
|
| If the username or email address already exists, I want to return an error
| prompting the visitor to try another username or email address.
|
| I've set the properties of these fields in the access database to disallow
| duplicates. However, if a visitor enters a username or email address that
| already exists in the Access Database, the record is not added to the
| database but the user is unaware and can complete and submit the registration
| form.
|
| Any help would be greatly appreciated!
|
| Thanks in advance.
|
| Ryan
 
R

Rhyno

Hi Stephan

Thanks for getting back to me.

Unfortunately I'm no code wizard, I'm not sure exactly what you mean by use
the same process for logon... also don't know where the code you've provided
should go or how I should edit it...

Sorry, I'm trying but I think it's a case of fish out of water...

Ryan...
 
S

Stefan B Rusynko

The script on http://support.microsoft.com/kb/825498 is just a log on script for users already in the database
Somewhere you added a Register script for users not in the database
That is the one you need to Edit to sent to the log on script 1st & only if it fails, then send them to the register script

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi Stephan
|
| Thanks for getting back to me.
|
| Unfortunately I'm no code wizard, I'm not sure exactly what you mean by use
| the same process for logon... also don't know where the code you've provided
| should go or how I should edit it...
|
| Sorry, I'm trying but I think it's a case of fish out of water...
|
| Ryan...
|
|
|
| "Stefan B Rusynko" wrote:
|
| > Before you add to the DB always check for duplicates during registration
| >
| > Use the same process as your Log in, But check for EOF first (no record found )
| >
| > <%
| > IF objRS.EOF THEN ' not a dupe
| > ' do your registration ADD routine here
| > ELSE ' is a dupe
| > ' send them back to start page again with different credentials
| > END IF
| >
| > %>
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | Hi there
| > |
| > | I've created protected ASP pages in my website following instructions in
| > | article http://support.microsoft.com/kb/825498
| > |
| > | Users are prompted to log on or register if they aren't already registered.
| > |
| > | The registration form is split over two ASP pages. The first page simply
| > | asks for email address, username and password and, on submit, posts to the
| > | second ASP page.
| > |
| > | The second page asks the user for contact details (name, address etc.)
| > |
| > | I would like the first page of the registration to check the database to
| > | find if there are any records with the same username or email address before
| > | posting to the second page.
| > |
| > | If the username or email address already exists, I want to return an error
| > | prompting the visitor to try another username or email address.
| > |
| > | I've set the properties of these fields in the access database to disallow
| > | duplicates. However, if a visitor enters a username or email address that
| > | already exists in the Access Database, the record is not added to the
| > | database but the user is unaware and can complete and submit the registration
| > | form.
| > |
| > | Any help would be greatly appreciated!
| > |
| > | Thanks in advance.
| > |
| > | Ryan
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top