#31: Double-Checking a Credit Card's Expiration Date

When you accept a credit card, you'll need to know whether it has expired. In your HTML, it's best to create a drop-down menu that allows customers to choose their card's expiration date in order to avoid ambiguity in date formats:

<select name="cc_month"> <option value="01" >01 : January</option> <option value="02" >02 : February</option> <option value="03" >03 : March</option> <option value="04" >04 : April</option> <option value="05" >05 : May</option> <option value="06" >06 : June</option> <option value="07" >07 : July</option> <option value="08" >08 : August</option> <option value="09" >09 : September</option> <option value="10" >10 : October</option> <option value="11" >11 : November</option> ...

Get Wicked Cool PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.