Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 27th, 2006, 12:55 PM
Registered User
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Duplicate database entry redirection error page


Im trying to set up a system where a user can register for a certain file. I have set up a database where their username and file selection (from a drop down menu) are inserted into a table (made in mysql) upon clicking register. However, I dont want them to be able to register twice for the same thing, i.e. I dont want username + file duplicates. So I have made the username and file fields in my table as primary keys, thus when a none unique entry is made i.e. a duplicate, I want the user to be redirected to an error page telling them their selection is invalid.
Ok, I know you can use the Check New Username feature under server behaviours but the problem is that it only accepts one field to check against - and either choice username or file still redirect me to exception report internal error page - not very user friendly!

Is there a way to get the condition on both username and file via html code or any other means, and redirect to a custom error page to tell the user to try again? Any help would be extremely welcome. Thanks!

Reply With Quote
  #2 (permalink)  
Old December 29th, 2006, 01:28 AM
Friend of Wrox
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran

you can use ajax, it will contact with server in html page, so try to do in ajax, if u want to get any help regading ajax, visit my msn space.

(Anything is Possible)
Reply With Quote
  #3 (permalink)  
Old December 29th, 2006, 08:26 AM
Registered User
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Thankyou for your reply! I will certainly have a look at AJAX.

However, I found a way to create a custom error message, as opposed to the http 500 error page. This isnt the absolute solution to redirecting to a custom error page specific to a duplicate entry error, but is an error page for whatever error crops up, and so overrides the default http 500 page!

All you need to do, if you are using Java, is to insert errorPage="yourcustomerrorpage.jsp" into:

<%@page language="java" import="java.sql.*"%> (top of the code)

So that you get...

<%@page language="java" import="java.sql.*" errorPage="yourcustomerrorpage.jsp"%>

Obviously, yourcustomerrorpage, is a page you made yourself!

This worked for me, hope it helps other people too!

Reply With Quote
  #4 (permalink)  
Old December 29th, 2006, 10:17 AM
Registered User
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Surendran,

I had a look on your site, but couldnt find any info relating to my duplicate entry problem?! Whereabouts is this info?


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for Duplicate Records in Data Entry Form roznix Access VBA 5 June 7th, 2012 08:53 AM
Checking for duplicate entry in Database sharon5469 ASP.NET 1.0 and 1.1 Basics 1 November 18th, 2007 06:08 PM
Duplicate database entry redirection error page EmWebs Access ASP 0 December 27th, 2006 12:54 PM
avoid duplicate entry of records mikersantiago Classic ASP Basics 4 February 10th, 2005 09:14 PM
deleting only 1 duplicate entry qwjunk Classic ASP Databases 3 February 2nd, 2004 11:45 AM

All times are GMT -4. The time now is 01:20 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.