|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Fun with CC exp dates
hey there - found a problem with my expiration validation thing that effects .000001 percent of users - but hey, they gotta buy stuff too... here's my code:
' validates expiration if DateDiff("d", Month(Now)&"/"&Year(now), request.form("expMonth")&"/20"&request.form("expYear"))<=0 then response.redirect "PaymentForm.asp?message="&Server.UrlEncode("Your Credit Card is expired. Please check your expiration date and try again.") end if as you can see... the problem is that if someone's credit card expires THIS month, the system thinks it's expired. So how do I tell it to check if the expiry is a month BEFORE this then fault it, if it's this month... let it pass. Thanks! |
|
#2
|
||||
|
||||
|
Just minus one off the Month function result.
(Month(Now) - 1) I think. Try it out and let me know. |
|
#3
|
|||
|
|||
|
there we go!
I had been putting that "-1" just about everywhere but the right place... thanks! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Fun with CC exp dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|