Page 1 of 1

parse error on credit card validation script

Posted: Mon Jul 15, 2002 1:33 pm
by fariquzeli
I'm using a pre-made credit card validation script I found and i implemented it exactly as you're supposed to and I get an error message

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/ttoomey/pancorp.com/newsletter/class.creditcard.php on line 18

it occurs in this area of the code

Code: Select all

class CCreditCard { 
// Class Members 
var $__ccName = ''; 
var $__ccType = ''; 
var $__ccNum = ''; 
var $__ccExpM = 0; 
var $__ccExpY = 0;

// Constructor function 
CCreditCard($name, $type, $num, $expm, $expy) {
on the line CCreditCard($name, $type, $num, $expm, $expy) {

anyone know what it is?

Posted: Mon Jul 15, 2002 2:10 pm
by gnu2php
I think it's because you forgot the function statement:

Code: Select all

function CCreditCard($name, $type, $num, $expm, $expy) {

Posted: Mon Jul 15, 2002 2:12 pm
by fariquzeli
oh my
now i feel like a retard again, thanks i'm new to OOP.