parse error on credit card validation script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

parse error on credit card validation script

Post 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?
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

I think it's because you forgot the function statement:

Code: Select all

function CCreditCard($name, $type, $num, $expm, $expy) {
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

Post by fariquzeli »

oh my
now i feel like a retard again, thanks i'm new to OOP.
Post Reply