CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Credit card auth

Print topic Send  topic

Author Message
Peter
Posted: 08/05/2007, 2:05 PM

Hi all

I am new to codecharge studio 2.3. I am trying to get codecharge to validate
a credit card number. The code I have tried does not seem to work or I am
putting it in the wrong place The code is as follows:

// MOD 10 checks
function check_number( $cardnumber ) {

$dig = toCharArray($cardnumber);
$numdig = sizeof ($dig);
$j = 0;
for ($i=($numdig-2); $i>=0; $i-=2){
$dbl[$j] = $dig[$i] * 2;
$j++;
}
$dblsz = sizeof($dbl);
$validate =0;
for ($i=0;$i<$dblsz;$i++){
$add = toCharArray($dbl[$i]);
for ($j=0;$j<sizeof($add);$j++){
$validate += $add[$j];
}
$add = '';
}
for ($i=($numdig-1); $i>=0; $i-=2){
$validate += $dig[$i];
}
if (substr($validate, -1, 1) == '0') { return 1; }
else { return 0; }
}

Please help.

Thanks

Peter
mamboBROWN


Posts: 1713
Posted: 08/05/2007, 7:52 PM

Peter
You don't have CCS 3.1 or 3.2?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.