Coupon Code Enter Get Instant Result

Hello

My MySQL database will have coupon codes in it. When someone visit my website they will enter a coupon code(that is register already on my database), I want to use Ajax to give them an answer straight away if there coupon is valid or not and then is it valid jump the user to a webpage… Does anyone have an example of something similar to this? I know how to create tables in the database but don’t know how to validate the coupon code. :wink:

Thanks
:stare: