Jump to content

Error, but not sure why?


mattspriggs28

Recommended Posts

I have the following code:

 

class paypal_class {

private $ipn_status;                // holds the last status
public $admin_mail; 	// receive the ipn status report pre transaction
public $paypal_mail;	// paypal account, if set, class need to verify receiver
public $txn_id;		// array: if the txn_id array existed, class need to verified the txn_id duplicate
public $ipn_log;                    // bool: log IPN results to text file?
private $ipn_response;              // holds the IPN response from paypal   
public $ipn_data = array();         // array contains the POST values for IPN
private $fields = array();          // array holds the fields to submit to paypal
private $ipn_debug; 				// ipn_debug

// initialization constructor.  Called when class is created.
function __construct() { 
etc...

 

Howerver, I'm getting the error Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' on Line 3

 

Any ideas as to why this may be? It's a Paypal IPN script that I downloaded and looking at the responses it received seemed to work fine for everyone else.

 

Thanks for your help.

Link to comment
https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/
Share on other sites

The PHP 4 way to define class properties is to use the var keyword. So something like this:

 

class paypal_class {

var $ipn_status;                // holds the last status
var $admin_mail; 	// receive the ipn status report pre transaction
var $paypal_mail;
...

 

But because this class was apparently developed for PHP 5 there's a good chance you'll run into other compatibility issues as well.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.