nemonoman, I need help with this. All I know about PHP is what I have learned from this forum.
Anyway, how do I use the script you just gave above?
I tried doing this:
<?php
//form.php
function CardCheck($ccNum, $ccType = '') {
if (!isset($ccNum)) return FALSE;
// Make credit card number purely numeric
$ccnum = ereg_replace('[[:digit:]]+', '', $ccNum);
// Validate digit length for Visa
if (ereg('4', $ccNum)) {
$ccType = "V";
if (strlen($ccNum) <> 13 && strlen($ccNum) <> 16) return FALSE;
}
.......then the rest of the code. Plus underneath this I have error checking for empty fields that are required.
The form action is: action=<? $PHP_SELF ?>
But the credit card validation is a function. So how do I tell it to run the CardCheck function and the $PHP_SELF at the same time? Or what do I need to put as the action for the form?
I have attached a .txt file of all the code and the way I have it set up. Of course I know it is wrong because it isn't working.
Can you help?
Thanks.