<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1026764" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1026764</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/credit-card-format-check#comment-1160696</link>
    <description> &lt;p&gt;Another way is to force the required input length.&lt;/p&gt;
&lt;p&gt;Using form input boxs set them to required length, ie 4,3,3,3 or whatever they are.&lt;br /&gt;
If you want to get fancy you could use a javascript switch, so they choose a card type, and on that choice the fields are displayed (if you needed 6,4,4 or whatever) then you could just validate the fields seperatly, then join them and do whatever with them - store, send ... &lt;/p&gt;
&lt;p&gt;visa&lt;br /&gt;
input(maxsize 4) - input(maxsize 4) - input(maxsize 4) - input(maxsize 4)&lt;/p&gt;
&lt;p&gt;amex&lt;br /&gt;
input(maxsize 4) - input(maxsize 6) - input(maxsize 5)&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Oct 2004 00:35:37 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1160696 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/credit-card-format-check#comment-1160672</link>
    <description> &lt;p&gt;Here is the only one on that link for Credit Cards:&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
Expression:  ^((4\d{3})|(5[1-5]\d{2}))(-?|\040?)(\d{4}(-?|\040?)){3}|^(3[4,7]\d{2})(-?|\040?)\d{6}(-?|\040?)\d{5}&lt;/p&gt;
&lt;p&gt;Description:   Credit card validator for AMEX, VISA, MasterCard only. Allows spaces, dashes, or no separator between digit groups according to the layout (4-6-5 for AMEX, 4-4-4-4 for Visa and Mastercard)  &lt;/p&gt;
&lt;p&gt;Matches:  [3711-078176-01234], [4123 5123 6123 7123], [5123412361237123]&lt;/p&gt;
&lt;p&gt;Non-Matches:  [3711-4123-5123-6112]
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This would be quite close, just need to add one for Discover cards (starts with a 6) and one for the older (don&#039;t know if really need them, but better safe than sorry) 13 digit (4-3-3-3) visas&lt;/p&gt;
&lt;p&gt;Then would still need to use the other code for doing the checksum on the card number. &lt;/p&gt;
&lt;p&gt;I&#039;ll try adapting this in later today.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Fri, 22 Oct 2004 11:02:06 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1160672 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/credit-card-format-check#comment-1160669</link>
    <description> &lt;p&gt;try this site for php expressions&lt;br /&gt;
&lt;a href=&quot;http://www.regexplib.com/DisplayPatterns.aspx?cattabindex=2&amp;amp;categoryId=3&quot; class=&quot;bb-url&quot;&gt;http://www.regexplib.com/DisplayPatterns.aspx?cattabindex=2&amp;amp;categoryId=3&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;hopefully you can find something usefull&lt;/p&gt;
 </description>
     <pubDate>Fri, 22 Oct 2004 10:11:42 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1160669 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/credit-card-format-check#comment-1160663</link>
    <description> &lt;p&gt;Surely using regular expressions would abbreviate a lot of this code. I might have a crack at it later.&lt;/p&gt;
&lt;p&gt;It might be a good idea to turn it into a class, so the code is more easily deployed. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 22 Oct 2004 07:29:49 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1160663 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
